I am sure that the Android SDK is not trying to change your PATH variable for you. If you want to be able to run the SDK tools without specifying the full path, you will need to add the folder (s) containing them to your PATH one at a time.
You can do this by editing ~/.bash_profile and adding such a line (or by editing an existing line if you already have one):
export PATH="$PATH:/PATH/TO/android-sdk-macosx/build-tools/17.0.0"
Alternatively, you can simply specify the full path to the tool when it is called, for example:
/PATH/TO/android-sdk-macosx/build-tools/17.0.0/aapt v
I'm not sure if this happens with aapt , but it can be useful for disambiguation if multiple versions of the tool are installed. To find out which version of the command bash resolves with, you can usually find out by running which , for example:
which aapt
EDIT
There were a lot of good comments in this answer, including Jared's great suggestion to dynamically add last paths to the path . I redefined its code in pure 3.x bash, this is what is currently in my ~/.bash_profile . First, be sure to set ANDROID_HOME :
export ANDROID_HOME="$HOME/Library/Android/sdk"
Then (if you are using bash):
BUILD_TOOLS=($ANDROID_HOME/build-tools/*) ANDROID_LATEST_BUILD_TOOLS="${BUILD_TOOLS[@]:(-1)}" export PATH="$PATH:$HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_LATEST_BUILD_TOOLS"
Alternatively, here is a version of POSIX that should work in any shell:
ANDROID_LATEST_BUILD_TOOLS=$(ls -r ${ANDROID_HOME}/build-tools|head -1) export PATH="$PATH:$HOME/bin:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_LATEST_BUILD_TOOLS"
Eliot
source share