Skip to content

Instantly share code, notes, and snippets.

@tobias-johansson
Last active August 29, 2015 14:13
Show Gist options
  • Save tobias-johansson/2d7d64a5807a02025562 to your computer and use it in GitHub Desktop.
Save tobias-johansson/2d7d64a5807a02025562 to your computer and use it in GitHub Desktop.
Update android sdk tools on CI server
#!/bin/bash
## Dump list, for reference
# android list sdk -u -a -e
## No 'tag' for getting latest build tools, for some reason
BUILD_TOOLS_LATEST=$(android list sdk -u -a -e | grep 'build-tools-' | head -n 1 | cut -d' ' -f2)
## Run through expect to accept license
expect -c "
set timeout -1;
spawn android update sdk -u -a -t tool,platform-tool,$BUILD_TOOLS_LATEST,extra-google-m2repository,extra-android-m2repository;
expect {
\"Do you accept the license\" { exp_send \"y\r\" ; exp_continue }
eof
}
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment