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:
export PATH=$PATH:/Users/PTyagi/Developer/android/sdks/android-sdk-macosx/tools:/Users/PTyagi/Developer/android/sdks/android-sdk-macosx/platform-tools
export ANDROID_HOME=/Users/PTyagi/Developer/android/sdks/android-sdk-macosx
Close the Terminal session and open new one and try echo $ANDROID_HOME to check. It should print the path to SDK home.
Very informative post.Thanks for sharing it.
ReplyDeleteandroid application development company
Please share the steps to Setting environmental variables for Android development in Windows 7.
ReplyDelete