Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -e |
| 3 | set -x |
| 4 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 5 | SDK_VERSION=24.4.1 |
Alexander Afanasyev | 652fb8e | 2017-07-07 10:46:09 -0700 | [diff] [blame] | 6 | BUILD_TOOLS_VERSION=26.0.0 |
| 7 | COMPILE_SDK_VERSION=26 |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 8 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 9 | SDK=android-sdk-linux |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 10 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 11 | export ANDROID_HOME=`pwd`/$SDK |
| 12 | export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools |
| 13 | |
| 14 | if [ ! -d $SDK ]; then |
| 15 | wget -nv http://dl.google.com/android/android-sdk_r$SDK_VERSION-linux.tgz |
| 16 | tar zxf android-sdk_r$SDK_VERSION-linux.tgz |
| 17 | rm android-sdk_r$SDK_VERSION-linux.tgz |
Alexander Afanasyev | 087c7c1 | 2015-02-02 00:21:21 -0800 | [diff] [blame] | 18 | |
| 19 | echo "y" | android update sdk --filter platform-tools,build-tools-$BUILD_TOOLS_VERSION,android-$COMPILE_SDK_VERSION,extra-android-support,extra-android-m2repository,extra-google-m2repository --no-ui --all --force |
| 20 | echo "y" | android update sdk --filter "android-19" --no-ui --all --force |
| 21 | fi |
| 22 | |
Alexander Afanasyev | f381256 | 2016-01-21 16:28:33 -0800 | [diff] [blame] | 23 | echo sdk.dir=`pwd`/$SDK >> local.properties |