How to update SDK in Android Studio in the background

You can go to tools -> android -> sdk manager and click on Launch stand alone sdk manager hyperlink. This will open sdk manager outside android studio, select the packages and download. You can continue to work on android studio this way.

enter image description here


The "Launch standalone SDK Manager" option seems to be gone in Android Studio 2.3.3 for Windows. However, there is sdkmanager.bat in \tools\bin


It is possible to do it all by code using the sdkmanager tool.

The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK.

This is an example using the sdkmanager with the command line:

  1. First at all, the sdkmanager is located in android_sdk/tools/bin/.
  2. Go where the sdkmanager is located
  3. List installed and available packages using this command:

sdkmanager --list

The result willl be something similar to this

enter image description here

  1. In my case I want to Download a System Image with Release Name "P" with ABI x86 ( I saw this information from Android Studio)

enter image description here

  1. The next step is to search that system image in your list

enter image description here

  1. Finally install this package in this way:

./sdkmanager "system-images;android-P;google_apis;x86"

This will begin the process of downloading the package enter image description here

  1. After finish you can check that the image is available to use

enter image description here

For more info: https://developer.android.com/studio/command-line/sdkmanager.html#usage