3

THE SITUATION:

Everytime i have to do some operations in the console for an app i got the following error:

ANDROID_HOME is not set and "android" command not in your PATH.

THE SOLUTION:

I have found the following solution: In order to specify the path of ANDROID_HOME I Copy paste these two lines in the console (that path is my own path to the folder android-sdk-macosx - you may have a different path):

export ANDROID_HOME=/usr/local/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

It works fine. But the fact is that the next time i open the Terminal i have to repeat the operation again.

THE QUESTION:

How can i save this path as permanent in the MAC terminal?

FrancescoMussi
  • 20,760
  • 39
  • 126
  • 178
  • possible duplicate of [Setting environment variables in OS X?](http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x) – ap0 Aug 10 '15 at 06:53

1 Answers1

5

At the command line do the following:

Edit the file ~/.profile and add the two lines from your post.

export ANDROID_HOME=/usr/local/android-sdk-macosx export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

Any already open terminal windows you will need to source the file like this:

. ~/.profile

Any new terminal windows will load those settings automatically.


If you are doing Android development on Mac you may like http://LogRabbit.com for viewing your device logs.

Yepher
  • 1,465
  • 12
  • 25