sdkmanager is a command-line tool that lets you view, install,
update, and uninstall packages for the Android SDK. If you're using Android
Studio, then you don't need to use this tool, and you can instead manage your
SDK packages from the IDE.
sdkmanager tool is provided in the
Android SDK Command-Line Tools package.
To use the SDK Manager to install a version of the command-line tools,
follow these steps:
- Download the latest "command line tools only" package from the Android Studio downloads page and unzip the package.
- Move the unzipped
cmdline-toolsdirectory into a new directory of your choice, such as android_sdk. This new directory is your Android SDK directory.
- In the unzipped
cmdline-toolsdirectory, create a sub-directory called
- Move the original
cmdline-toolsdirectory contents, including the
source.propertiesfile, into the newly created
latestdirectory. You can now use the command-line tools from this location.
(Optional) To install a previous version of the command-line tools, run the following command:
android_sdk/cmdline-tools/latest/bin/sdkmanager --install "cmdline-tools;version"Substitute
versionwith the version you want to install, for example
You can use the
sdkmanager to list installed and available packages, install
packages, and update packages. For more details, see the following sections.
List installed and available packages
To list installed and available packages, use the following syntax:
sdkmanager --list [options] \ [--channel=channel_id] // Channels: 0 (stable), 1 (beta), 2 (dev), or 3 (canary)
channel option to include a package from a channel up to and
channel_id. For example, specify the canary channel to list
packages from all channels.
To install packages, use the following syntax:
sdkmanager packages [options]
The packages argument is an SDK-style path, as shown with
--list command, wrapped in quotes. For example,
You can pass multiple package paths, separated with a space, but they must each be wrapped in their own set of quotes. For example, here's how to install the latest platform tools and the SDK tools for API level 33:
sdkmanager "platform-tools" "platforms;android-33"
Alternatively, you can pass a text file that specifies all packages:
sdkmanager --package_file=package_file [options]
The package_file argument is the location of a text file in which each line is an SDK-style path of a package to install (without quotes).
To uninstall, add the
sdkmanager --uninstall packages [options] sdkmanager --uninstall --package_file=package_file [options]
To install CMake or the NDK, use the following syntax:
sdkmanager --install ["ndk;major.minor.build[suffix]" | "cmake;major.minor.micro.build"] [--channel=channel_id] // NDK channels: 0 (stable), 1 (beta), or 3 (canary)
For example, use the following command to install the specified NDK version regardless of which channel it is currently on:
sdkmanager --install "ndk;21.3.6528147" --channel=3 // Install the NDK from the canary channel (or below) sdkmanager --install "cmake;10.24988404" // Install a specific version of CMake
Update all installed packages
To update all installed packages, use the following syntax:
sdkmanager --update [options]
You are required to accept the necessary license for each package you have installed. This step occurs during the installation flow when you install packages from within Android Studio.
If you don't have Android Studio installed, or it is for a CI server or other headless Linux device without a GUI installed, do the following from the command-line:
This prompts you to accept any licenses that haven't already been accepted.
The following table lists the available options for the commands listed in the preceding section:
||Use the specified SDK path instead of the SDK containing this tool.|
||Include packages in channels up to and including channel_id. Available
||Include obsolete packages in the package listing or package updates.
For use with
||Force all connections to use HTTP rather than HTTPS.|
||Verbose output mode. Errors, warnings and informational messages are printed.|
||Connect via a proxy of the given type: either
||IP or DNS address of the proxy to use.|
||Proxy port number to connect to.|