sdkmanager

The sdkmanager is a command line tool that allows you to view, install,
update, and uninstall packages for the Android SDK. If you're using Android
Studio, then you do not need to use this tool and you can instead manage your
SDK packages from the IDE.

The sdkmanager tool is provided in the Android SDK Tools package
(25.2.3 and higher) and is located in
android_sdk/tools/bin/.

Usage

You can use the sdkmanager to perform the following tasks.

List installed and available packages

sdkmanager --list [options]

Install packages

sdkmanager packages [options]

The packages argument is an SDK-style path as shown with
the --list command, wrapped in quotes (for example,
"build-tools;29.0.0" or
"platforms;android-28"). 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 (which includes
adb and fastboot) and the SDK tools for API level 28:

sdkmanager "platform-tools" "platforms;android-28"

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).