Created
April 10, 2014 18:13
-
-
Save yuvipanda/10408391 to your computer and use it in GitHub Desktop.
Setup android sdk automatically
This file contains hidden or 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
SDK_HOME_PATH="$HOME" | |
SDK_PATH="$SDK_HOME_PATH/android-sdk-linux" | |
# Needs to be updated when new releases are made | |
SDK_DOWNLOAD_URL="http://dl.google.com/android/android-sdk_r22.6.2-linux.tgz" | |
curl --location $SDK_DOWNLOAD_URL | tar -xz -C $SDK_HOME_PATH | |
# Just install platform-tools, build-tools & Android-19 | |
expect -c " | |
set timeout -1; | |
spawn $SDK_PATH/tools/android update sdk -u --filter 1,2,4 | |
expect { | |
\"Do you accept the license\" { exp_send \"y\r\"; exp_continue } | |
eof | |
} | |
" |
android update sdk -u --filter "platform-tools,build-tools-19.1.0,android-19"
Hey thanks for the expect script, saved me from doing dirty and horrible things like echo "y" | android update sdk -a -u ....
I used your solution relicmelex ! For me it seems to be the prettiest <3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instead of using the positional id filters (which depends on what you have installed already and can change over time) it would be better to use filter names, which is more stable.
You can get the list of names with
android list sdk -e -a