Wednesday, June 13, 2012

Setting Android Environment Variable

When debugging android applications, I always use the terminal to check the logcat but using it I still have to go to tools directory under android sdk.  It's very inconvenient for me since I cannot use the android commands in other directories.  By default, setting up the android sdk into Eclipse for the first time, ANDROID_HOME environment variable isn't setup by linux file system.  To setup,

open the terminal and edit the .bashrc file and add these lines at the end of the file:
ANDROID_HOME=/home/path_to_/android-sdk-linux
export ANDROID_HOME

and then append this to the current PATH
PATH=$PATH:$JAVA_HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export PATH

The tools and platform-tools directory are the most important here since they contain all the android-related commands.

No comments:

Post a Comment