Set ANDROID_HOME environment variable in mac

dharmendra vaishnav picture dharmendra vaishnav · Feb 3, 2015 · Viewed 152.9k times · Source

I am new in developing native app using Salesforce SDK. I tried to create android project from command line using forcedroid tool but there is problem in setting environment variable named ANDROID_HOME.

But i don't know how to set this variable.

I am attaching screenshot to describe my problem correctly.

enter image description here

Answer

Tiago Gouvêa picture Tiago Gouvêa · Nov 10, 2015

To make it permanent on your system and the variable keep working after close the terminal, ou after a restart use:

nano ~/.bash_profile 

Add lines:

export ANDROID_HOME=/YOUR_PATH_TO/android-sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/emulator

Reopen terminal and check if it worked:

source ~/.bash_profile
echo $ANDROID_HOME