sdkmanager
Manage Android SDK packages, tools, and emulators
TLDR
List available packages
Install a package
Update every installed package
Uninstall a package
SYNOPSIS
sdkmanager [--sdk_root=<sdkRootPath>] [options] [packages...]
sdkmanager --list
sdkmanager --install <package>
sdkmanager --uninstall <package>
sdkmanager --update
sdkmanager --licenses
PARAMETERS
--list
Lists all installed and available packages.
--install <package_path>
Installs specified packages. Package paths are typically semi-colon separated, e.g., "platforms;android-34" or "build-tools;34.0.0".
--uninstall <package_path>
Uninstalls specified packages.
--update
Updates all installed packages to their latest available versions.
--licenses
Shows and allows interaction with Android SDK licenses. Accepting licenses is often required before installing new packages.
--sdk_root=<path>
Specifies the path to the SDK installation. If not set, it defaults to the ANDROID_HOME environment variable or a default location based on the operating system.
--channel=<channel_id>
Specifies the update channel for packages (0=Stable, 1=Beta, 2=Dev, 3=Canary). Default is Stable.
--verbose
Enables verbose output for more detailed information during execution.
--no_https
Forces the use of HTTP instead of HTTPS for package downloads. Use with caution due to security implications.
--include_obsolete
Includes obsolete packages in the list output when used with --list.
--proxy={http|socks} --proxy_host=<host> --proxy_port=<port>
Configures proxy settings for network connections.
DESCRIPTION
sdkmanager is a command-line tool provided with the Android SDK that allows developers to view, install, update, and uninstall various Android SDK packages. It is an indispensable utility for managing SDK components without a graphical user interface, making it ideal for automation, continuous integration (CI) environments, and server setups. This tool provides fine-grained control over SDK platforms, build tools, system images for emulators, documentation, and other essential components required for Android development. It superseded older command-line tools like android update sdk, offering a more streamlined and robust experience for SDK management.
CAVEATS
Requires a Java Development Kit (JDK) to be installed and properly configured in your system's PATH. Downloads can be significantly large and time-consuming, requiring a stable internet connection. On Linux and macOS, ensure the sdkmanager script has execute permissions (chmod +x). It's crucial to accept the SDK licenses using sdkmanager --licenses before attempting to install most packages, otherwise, installations will fail.
COMMON USAGE EXAMPLES
List all available and installed packages:
sdkmanager --list
Install Android Platform 34 and Build-Tools 34.0.0:
sdkmanager "platforms;android-34" "build-tools;34.0.0"
(You will be prompted to accept licenses or run sdkmanager --licenses first.)
Update all installed packages:
sdkmanager --update
LOCATION
sdkmanager is typically found in the cmdline-tools/latest/bin/ subdirectory within your Android SDK installation. For example, on Linux, this might be $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager.
HISTORY
sdkmanager was introduced as part of Android SDK Tools version 25.3.0, released in late 2016. It was developed to replace and modernize the functionality previously handled by the deprecated android command-line tool, specifically its 'update sdk' features. This shift aimed to provide a more modular, robust, and scriptable interface for managing Android SDK components, better supporting automated build processes and continuous integration environments that rely on headless SDK installations.