8

I want to write a script to update the Android SDK platform tools and I need the command if available to run in order to achieve this. What I have found is that I can use the Android command under the /tools directory to update the software (images, sources, etc.), but nothing to update the tools themselves.

The guide on Factory Images for Nexus Devices says that I must be sure I have the latest tools

Be sure that you have the latest version of the Android SDK Platform-tools from the SDK Manager.

So, is it possible? If it is, how to do that?

4

After further research, I came across this article from Stack Overflow that explains it and states that the Android command that can be used to update the platform-tools in the SDK directory.

You follow these instructions as shown on the above link

$ android list sdk
$ android update sdk --no-ui --filter 1,platform-tools

The first command lists the available packages that are still to be installed (indexed by number), as for example:

Packages available for installation or update: 9
   1- Android SDK Tools, revision 19
   2- Android SDK Platform-tools, revision 11
   ...

According to that list, you can issue the second command to install the packages that you want to install.

The --filter option limits the update to the packages that you want to install. You specify those packages in a comma-separated format. Also, you can filter them by the index number provided in the listing resulting from the first command.

  • What does --filter 1 do here? – IgorGanapolsky Nov 14 '16 at 20:58
2

Use of android tool is deprecated; instead use sdkmanager:

 androidsdk/tools/bin/sdkmanager --update

https://developer.android.com/studio/command-line/sdkmanager.html

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.