Last active
September 28, 2015 13:14
-
-
Save dirkk0/9b325888a268a595bfce to your computer and use it in GitHub Desktop.
install_android.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install --yes build-essential curl git unzip | |
# install java | |
sudo apt-get -y install openjdk-7-jdk | |
# make exports persistent | |
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc | |
echo "export PATH=\${PATH}:\${JAVA_HOME}/bin" >> ~/.bashrc | |
source ~/.bashrc | |
# install 32-bit dependencies | |
# http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html | |
sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6 | |
sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev | |
sudo apt-get install -y g++-multilib | |
# install android | |
wget http://dl.google.com/android/android-sdk_r24.3.3-linux.tgz | |
tar -xvzf android-sdk_r*.tgz | |
# make exports persistent | |
# echo "export PATH=\${PATH}:~/android-sdk-linux/tools" >> ~/.bashrc | |
# echo "export PATH=\${PATH}:~/android-sdk-linux/platform-tools" >> ~/.bashrc | |
# echo "export ANDROID_SDK_HOME=/home/ubuntu/android-sdk-linux" >> ~/.bashrc | |
# echo "export ANDROID_SDK=/home/ubuntu/android-sdk-linux" >> ~/.bashrc | |
# echo "export ANDROID_HOME=/home/ubuntu/android-sdk-linux" >> ~/.bashrc | |
echo "export ANDROID_HOME=/home/ubuntu/android-sdk-linux" >> ~/.bashrc | |
echo "export PATH=\${PATH}:\${ANDROID_HOME}/tools" >> ~/.bashrc | |
echo "export PATH=\${PATH}:\${ANDROID_HOME}/platform-tools" >> ~/.bashrc | |
source ~/.bashrc | |
export ANDROID_HOME=~/android-sdk-linux | |
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools | |
# install 32-bit dependencies and dev | |
# http://sixarm.com/about/ubuntu-apt-get-install-ia32-for-32-bit-on-64-bit.html | |
sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6 lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev | |
sudo apt-get install -y g++-multilib | |
sudo apt-get install -y android-tools-adb android-tools-fastboot | |
adb kill-server; adb start-server; adb devices | |
# installs build-tools | |
echo "yes" | android update sdk --all --no-https --no-ui --filter build-tools-22.0.1,android-22,extra-android-support,sys-img-armeabi-v7a-android-22 | |
# dunno. If we dont do this, the linter fails. | |
echo "yes" | android update sdk --no-https --no-ui --filter 1 | |
# version compatibilty: | |
# http://tools.android.com/tech-docs/new-build-system/version-compatibility | |
sudo add-apt-repository --yes ppa:cwchien/gradle | |
sudo apt-get update | |
# sudo apt-get -y install gradle-2.1 | |
# sudo apt-get -y remove gradle-2.1 | |
sudo apt-get install -y gradle-2.4 | |
git clone https://github.com/spring-guides/gs-gradle-android.git | |
cd gs-gradle-android/initial; gradle build -x lint | |
#### to run the emulator do this (via # via https://github.com/embarkmobile/android-sdk-installer ) | |
# echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a | |
# emulator -avd test -no-skin -no-audio -no-window | |
# you can not run the emulator on standard EC2 instances, though. | |
# you need a g2.2xlarge instance to do so: http://lg.io/2015/07/05/revised-and-much-faster-run-your-own-highend-cloud-gaming-service-on-ec2.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment