Setting environmental variables or paths to Android SDK tools in ~/.bash_profile sounds so simple ! But its not quite standard when it comes to Mac OSX. In linux, you can simply use export command in ~/.bash_profile and your're done. But in Mac OSX, you have couple of options like bash.rc, bash_profile, /etc/profile and environment.plist etc. I was so confused when all I wanted was to simply have a environmental variable for ANDROID_HOME and want to access SDK tools like android and adb from commandline. So, all I had to do was:
- Open Terminal
- Type vi ~/.bash_profile in command line. It creates it, if its already not there
- Type following in vi editor:
Close the Terminal session and open new one and try echo $ANDROID_HOME to check. It should print the path to SDK home.