Skip to content

Instantly share code, notes, and snippets.

@klaeufer
Last active August 29, 2015 14:16
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 klaeufer/4720abe6bdcc665f56a3 to your computer and use it in GitHub Desktop.
Save klaeufer/4720abe6bdcc665f56a3 to your computer and use it in GitHub Desktop.
Android SDK install script for Ubuntu on Codio
#!/bin/bash
# Download and run this script in a Codio terminal.
# (Workaround for Codio included at the bottom.)
#
# You should set these variables in /home/codio/.bashrc:
#
# export ANDROID_HOME=$HOME/android-sdk-linux
# export LD_LIBRARY_PATH=$HOME/lib32:$LD_LIBRARY_PATH
#
# Then develop your Android apps as usual, download manually,
# and install and run on emulator or device.
#
# See also this discussion:
# http://forum.codio.com/t/android-development-on-codio/1497
ANDROID_HOME=$HOME/android-sdk-linux
ANDROID_SDK_VERSION=24.1.2
ANDROID_BUILD_TOOLS_VERSION=21.1.1
ANDROID_API_LEVEL=19
pushd $HOME
wget http://dl.google.com/android/android-sdk_r${ANDROID_SDK_VERSION}-linux.tgz
tar -zxf android-sdk_r${ANDROID_SDK_VERSION}-linux.tgz
echo yes | ${ANDROID_HOME}/tools/android update sdk --filter tools,platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION},android-${ANDROID_API_LEVEL},extra-android-support,extra-android-m2repository,extra-google-m2repository --no-ui --force --no-https --all > /dev/null
rm android-sdk_r${ANDROID_SDK_VERSION}-linux.tgz
popd
# sudo/apt-get not supported on Codio
# sudo apt-get install -qq lib32stdc++6 lib32z1
LD_LIBRARY_PATH=$HOME/lib32
mkdir $LD_LIBRARY_PATH
pushd $LD_LIBRARY_PATH
function install_from() {
url=$1
wget $url
archive=$(basename $url)
dpkg -x $archive .
mv usr/lib32/* .
rm -rf $archive usr
}
install_from http://mirrors.kernel.org/ubuntu/pool/main/z/zlib/lib32z1_1.2.8.dfsg-1ubuntu1_amd64.deb
install_from http://mirrors.kernel.org/ubuntu/pool/main/g/gcc-4.6/lib32stdc++6_4.6.3-1ubuntu5_amd64.deb
popd
# end workaround
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment