Skip to content

Instantly share code, notes, and snippets.

@cybertk
Created October 22, 2014 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cybertk/28565ee95d74e65444e6 to your computer and use it in GitHub Desktop.
Save cybertk/28565ee95d74e65444e6 to your computer and use it in GitHub Desktop.
Android Development Environment Setup
MAC_SDK_DIR="/Applications/Android Studio.app/sdk"
LINUX_SDK_DIR="~/opt/android-sdk"
if [ -d "$MAC_SDK_DIR" ]; then
ANDROID_SDK=$MAC_SDK_DIR
fi
# Setup Android SDK Env
if [ -n "$ANDROID_SDK" ]; then
echo "Load Android SDK at $MAC_SDK_DIR"
# Path for SDK general tools
ANDROID_SDK_TOOL=$ANDROID_SDK/tools
# Path for SDK platform tools
ANDROID_SDK_PTOOL=$ANDROID_SDK/platform-tools
# Clear the path first
PATH=${PATH/$ANDROID_SDK_TOOL:/}
PATH=${PATH/$ANDROID_SDK_PTOOL:/}
# Setup path
export PATH=$ANDROID_SDK_TOOL:$PATH
export PATH=$ANDROID_SDK_PTOOL:$PATH
unset ANDROID_SDK_TOOL
unset ANDROID_SDK_PTOOL
unset ANDROID_SDK
fi
# Setup Android NDK path
if [ -n "$ANDROID_NDK" ]; then
# Clear the path first
PATH=${PATH/$ANDROID_NDK:/}
# Setup NDK Path.
export PATH=$ANDROID_NDK:$PATH
# Clear
unset ANDROID_NDK
fi
unset MAC_SDK_DIR
unset LINUX_SDK_DIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment