Skip to content

Instantly share code, notes, and snippets.

@hatak
Created April 12, 2012 02:32
Show Gist options
  • Save hatak/2364319 to your computer and use it in GitHub Desktop.
Save hatak/2364319 to your computer and use it in GitHub Desktop.
setup script for Android SDK & NDK
#!/bin/bash
# setup script for Android SDK & NDK
# for macosx lion
PATH_DEVELOPER=$HOME/Library/Developer
PATH_ANDROID=$PATH_DEVELOPER/Android
DIR_ANDROID_SDK="android-sdk"
DIR_ANDROID_NDK="android-ndk"
SDK_REVISION="18"
URL_ANDROID_SDK="http://dl.google.com/android/android-sdk_r${SDK_REVISION}-macosx.zip"
NDK_REVISION="7c"
URL_ANDROID_NDK="http://dl.google.com/android/ndk/android-ndk-r${NDK_REVISION}-darwin-x86.tar.bz2"
if [ -d ${PATH_ANDROID} ]; then
mkdir -p ${PATH_ANDROID}
fi
cd ${PATH_ANDROID}
# SDK
echo "Setup Android SDK"
if [ -d ${PATH_ANDROID}/${DIR_ANDROID_SDK} ]; then
echo ">>> Android SDK already installed"
else
echo ">>> Download archive of Android SDK Revision ${SDK_REVISION} ..."
#/usr/bin/curl -L ${URL_ANDROID_SDK} -o temp.zip
echo ">>> Extracting files ..."
#/usr/bin/unzip temp.zip && rm temp.zip
ln -s ${DIR_ANDROID_SDK}-macosx ${DIR_ANDROID_SDK}
fi
# NDK
echo "Setup Android NDK"
if [ -d ${PATH_ANDROID}/${DIR_ANDROID_NDK}-r${NDK_REVISION} ]; then
echo ">>> Latest Android NDK already installed."
else
echo ">>> Download archive of Android NDK Revision ${NDK_REVISIONK} ..."
#/usr/bin/curl -L ${URL_ANDROID_NDK} -o temp.tar.bz2
echo ">>> Extracting files ..."
#/usr/bin/tar xjf temp.tar.bz2 && rm temp.tar.bz2
ln -sf ${DIR_ANDROID_NDK}-r${NDK_REVISION} ${DIR_ANDROID_NDK}
fi
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment