I just had a heck of a time getting android sdk dependencies installed via command line and since the documentation that comes with the tools and online are woefully lacking, I thought I'd post what I discovered here.
I'm working with android sdk r24.4.1
for linux
. There are two commands that you can run to list the available packages:
android list sdk
and the more exhaustive:
android list sdk --all
The package numbers for specific packages differ for each command above! For example, the former lists package API 23.1 revision 3
as package #3
and the latter lists it as #29
.
Now, there are two different ways to install using the android command.
tools/android update sdk --no-ui --filter <package number>
and
tools/android update sdk -u -a -t <package number>
Given that the install commands each can take the package # as a parameter, which package number do you use? After much online searching and trial and error, I discovered that
android update sdk --no-ui --filter
uses the package numbers from android list sdk
and
android update sdk -u -a -t
uses the package numbers from android list sdk --all
In other words - to install API 23.1 revision 3
you can do either:
android update sdk --no-ui --filter 3
or
android update sdk -u -a -t 29
Crazy, but it works.