LinuxCommandLibrary

sdkmanager

Manage Android SDK packages, tools, and emulators

TLDR

List available packages

$ sdkmanager --list
copy

Install a package
$ sdkmanager [package]
copy

Update every installed package
$ sdkmanager --update
copy

Uninstall a package
$ sdkmanager --uninstall [package]
copy

SYNOPSIS

sdkmanager [options] [packages]

PARAMETERS

--list
    Lists all available and installed packages. Add `--verbose` for additional package details.

--install
    Installs the specified packages. Separate multiple packages with a space.

--uninstall
    Uninstalls the specified packages. Separate multiple packages with a space.

--update
    Updates all installed packages to the latest versions.

--channel=
    Selects which channel to use when installing packages. Available channels: stable, beta, dev, canary.

--include_obsolete
    Includes obsolete packages in the list of available packages.

--verbose
    Prints more detailed information during operations.

--no_https
    Forces to use http instead of https.

--sdk_root=
    Specifies the SDK root directory. If not specified, the ANDROID_HOME environment variable is used.

--licenses
    Displays and manages SDK licenses.

--version
    Prints the version of the sdkmanager.

--help
    Displays the help message.

DESCRIPTION

The sdkmanager is a command-line tool provided with the Android SDK for managing Android SDK packages. It allows you to list, install, update, and uninstall packages like platforms, system images, build tools, and platform tools.
It's a crucial tool for setting up your Android development environment and keeping your SDK up-to-date. The sdkmanager is especially useful when working in environments without a graphical user interface, such as continuous integration servers or remote machines. It simplifies the process of obtaining the necessary components for building and testing Android applications. It operates by communicating with the Android SDK repository to determine available packages and their dependencies and handles installation, updates and uninstallation process without the need for an IDE or graphic interface. The sdkmanager is generally located in the android_sdk/tools/bin directory.

CAVEATS

The sdkmanager requires a valid Java Development Kit (JDK) to be installed and configured correctly on your system. The ANDROID_HOME environment variable must be set correctly.

PACKAGE NAMES

Package names follow a specific format. For example, `platforms;android-33` refers to the Android 33 platform. `system-images;android-33;google_apis_playstore;x86_64` refers to the Google APIs Play Store system image for Android 33 on the x86_64 architecture. Use `--list` to find the exact package names.

LICENSE MANAGEMENT

When installing certain packages, you might need to accept licenses. Use `sdkmanager --licenses` to view and accept pending licenses before installing packages. This is often required when working with Android SDK build tools or platform components.

HISTORY

The sdkmanager was introduced as a replacement for the older android tool for managing SDK packages. It was designed to be more robust and easier to use, particularly in automated environments. It's evolved alongside the Android SDK, adding support for new package types and features as Android development has progressed.

SEE ALSO

adb(1), emulator(1)

Copied to clipboard