--filter
option to limit the installed packages:android update sdk --filter ...
--filter
option:android list sdk --all --extended
:android update sdk --filter tools,platform-tools,build-tools-19.0.3
etcAndroid SDK Tools
package contains new tool - sdkmanager - which simplifies this task of installing build-tools from the command line.android_sdk/tools/bin
folder. packages
argument is an SDK-style path, wrapped in quotes (for example, 'build-tools;25.0.0'
or 'platforms;android-25'
). You can pass multiple package paths, separated with a space, but they must each be wrapped in their own set of quotes.--no_https
), or in order to use proxy server (--proxy_host=address
and --proxy_port=port
).--help
flag. On my machine (Mac), the output is as following: platform tools
and build tools
without any other interaction. In the case the OP has put forth, the command would be adapted to:android sdk r24.4.1
for linux
. There are two commands that you can run to list the available packages:android list sdk
android list sdk --all
API 23.1 revision 3
as package #3
and the latter lists it as #29
. tools/android update sdk --no-ui --filter <package number>
tools/android update sdk -u -a -t <package number>
android update sdk --no-ui --filter
uses the package numbers from android list sdk
android update sdk -u -a -t
uses the package numbers from android list sdk --all
API 23.1 revision 3
you can do either:android update sdk --no-ui --filter 3
android update sdk -u -a -t 29
y/n
license prompts automatically.while/sleep
loop looks like simulation of the yes command, and in fact it is, well almost. The problem with yes
is that it floods stdout with 'y'
and there is virtually no delay between sending those characters and the version I had to deal with had no timeout option of any kind. It will 'pollute' stdout and the script will fail complaining about incorrect input. The solution is to put a delay between sending 'y'
to stdout, and that's exactly what while/sleep
combo does.expect
is not available by default on some linux distros and I had no way to install it as part of my CI scripts, so had to use the most generic solution and nothing can be more generic than simple bash script, right?sdkmanager
installed (I'm using MAC)sdkmanager --list
to list available packages.-t
switch.--all
switch.android list sdk --all
command (Ignoring obsolete packages).sdkmanager
click enter.sdkmanager
(space), double hyphen (--
), type listsdkmanager --list
(this lists all the packages in the SDK manager)python27
, expect
.--all
flag to be installed. You also better use a -t
filter flag to avoid installing ALL the packages but there is no way to filter all the build tools.