Wednesday, April 6, 2016

How to set Android Home environment variables to your MAC OSx

How to set Android Home environment variables to your MAC OSx

When you try to create project using terminal from your MAC BOOK (MAC OSx), you end up getting an error saying:

Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.

To resolve this error, you need to set the ANDROID HOME environment variable. 
  • Make sure you install the android SDK installed in your MAC.
  • Navigate to the installed location of android SDK and copy the path.
    • EX: /Users/Madhavan/Library/Android/sdk
  • Open the terminal and export ANDROID HOME variable.
    • export ANDROID_HOME=/Users/Madhavan/Library/Android/sdk
  • Set the path variable to ANDROID_HOME.
    • export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Open terminal and write your command like below:

Madhavan-Subramanian-MacBook-Pro: Madhavan$
export ANDROID_HOME=/Users/Madhavan/Library/Android/sdk

Madhavan-Subramanian-MacBook-Pro: Madhavan$

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools


No comments: