Skip to content

Instantly share code, notes, and snippets.

@Sy1v4in
Last active August 29, 2015 14:07
Show Gist options
  • Save Sy1v4in/c5fe82c8fbfce72c4284 to your computer and use it in GitHub Desktop.
Save Sy1v4in/c5fe82c8fbfce72c4284 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#Execute as root or sudo
cd /opt
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
tar zxvf android-sdk_r23.0.2-linux.tgz
chown -R root /opt/android-sdk-linux
chmod -R 755 /opt/android-sdk-linux
rm android-sdk_r23.0.2-linux.tgz
#Configuration for bash
cat > /etc/profile.d/android.sh << 'EOF'
export ANDROID_HOME="/opt/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
EOF
source /etc/profile
#Configuration for zsh environment
cat >> /etc/zsh/zprofile << 'EOF'
export ANDROID_HOME="/opt/android-sdk-linux"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
EOF
source /etc/zsh/zprofile
#sudo dpkg --add-architecture i386
apt-get --yes update
apt-get --yes install git-core lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --filter tools,platform-tools,build-tools-20.0.0,build-tools-19.1.0,extra-android-m2repository,extra-android-support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment