Skip to content

Installing Android SDK Tools

codepath-wiki-review[bot] edited this page Jun 1, 2026 · 68 revisions

The Android software development kit (SDK) is split across several packages: the Command-Line Tools (sdkmanager, avdmanager), Platform Tools (adb, sqlite3), Build Tools (aapt2, apksigner, d8 — the replacement for the legacy dx), Platforms (the API jars), and optional packages such as the emulator and NDK. See the official command-line tools overview for the full list, and ProGuard for shrinking/obfuscation.

The legacy tools/ package — which contained the android GUI/command and the tools/bin/sdkmanager script — was removed from updates and replaced by the Command-Line Tools package; the android command itself was retired in SDK Tools revision 25.3.0 (March 2017). The current sdkmanager lives at cmdline-tools/latest/bin/sdkmanager, and all of the manual install instructions below target that layout.

You can install the SDK through Android Studio, via Homebrew on macOS, or by downloading the Command-Line Tools archive manually.

Installing via Android Studio

Android Studio bundles the SDK and ships an in-IDE SDK Manager. Open Settings/Preferences > Languages & Frameworks > Android SDK and use the SDK Platforms and SDK Tools tabs to install the API levels and build tools your project needs. Make sure Android SDK Command-Line Tools (latest) is checked under SDK Tools so the sdkmanager binary is available on disk for CI and shell use.

Installing the Android SDK (via Homebrew)

On macOS, install the android-commandlinetools cask. The older android-sdk cask was discontinued upstream and has been disabled in Homebrew since late 2024.

  1. Install Homebrew — the package manager for macOS.
  2. Install a JDK if you don't have one (sdkmanager requires Java):
    brew install --cask temurin
  3. Install the Command-Line Tools:
    brew install --cask android-commandlinetools

The cask installs the SDK root at $HOMEBREW_PREFIX/share/android-commandlinetools (typically /opt/homebrew/share/android-commandlinetools on Apple Silicon, /usr/local/share/android-commandlinetools on Intel). Point ANDROID_HOME at that directory — see the Environment variables section below.

Installing the Android SDK (Manual Way)

If you want to bring up an SDK without Android Studio or Homebrew (for example, on a build server), download the Command-Line Tools archive directly.

  1. Open the Android Studio downloads page and scroll to Command line tools only. The archives are named commandlinetools-<os>-<build>_latest.zip (for example, commandlinetools-linux-14742923_latest.zip).

  2. Create a directory to act as your SDK root (e.g. ~/android-sdk) and download the archive into it.

  3. Unzip the archive. The zip unpacks to a top-level cmdline-tools/ directory containing bin/, lib/, NOTICE.txt, and source.properties. You must then re-arrange the contents into a latest subdirectory so the final layout is exactly:

    ~/android-sdk/
    └── cmdline-tools/
        └── latest/
            ├── bin/
            ├── lib/
            ├── NOTICE.txt
            └── source.properties
    

    The latest/ (or version-specific) subdirectory is required by sdkmanager; see the official install steps.

For example, on Linux:

mkdir -p ~/android-sdk/cmdline-tools
cd ~/android-sdk/cmdline-tools
wget https://dl.google.com/android/repository/commandlinetools-linux-14742923_latest.zip
unzip commandlinetools-linux-14742923_latest.zip
mv cmdline-tools latest

Check the downloads page for the current build number and SHA-256 before scripting this in CI.

Environment variables

Set ANDROID_HOME to your SDK root, and add the cmdline-tools/latest/bin and platform-tools directories to your PATH. The older ANDROID_SDK_ROOT variable is deprecated; Android Studio and the Android Gradle Plugin still honour it for backwards compatibility but will warn when both are set and disagree.

Edit your shell profile (~/.bash_profile, ~/.zshrc, etc.):

# Android
export ANDROID_HOME="$HOME/android-sdk"
export PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools"

Reload the profile:

$ source ~/.bash_profile

Installing packages with sdkmanager

List installed and available packages:

sdkmanager --list

Install a typical baseline (use the API level and build-tools version your project declares for compileSdk / buildToolsVersion):

sdkmanager "platform-tools" "platforms;android-36" "build-tools;36.0.0"

Update everything that is already installed:

sdkmanager --update

Accept the SDK licenses (the yes pipe is useful for non-interactive CI runs):

yes | sdkmanager --licenses

See the sdkmanager reference for the full command list, including --package_file, --channel, and --sdk_root flags.

Installing for Linux

On 64-bit Debian/Ubuntu hosts the emulator and a handful of native tools still expect 32-bit libraries to be present. Install them alongside a JDK that matches the Android Gradle Plugin's requirement (currently JDK 17 or newer):

sudo apt-get install libc6-dev-i386 lib32z1 openjdk-17-jdk

Adjust the JDK package name for your distribution's repositories.

Finding these guides helpful?

We need help from the broader community to improve these guides, add new topics and keep the topics up-to-date. See our contribution guidelines here and our topic issues list for great ways to help out.

Check these same guides through our standalone viewer for a better browsing experience and an improved search. Follow us on twitter @codepath for access to more useful Android development resources.

Clone this wiki locally