Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

sdkmanager command not found after installing the Android SDK

Errorsdkmanager: command not found

Short answer

sdkmanager lives in the Android Command-line Tools package, at cmdline-tools/latest/bin inside the SDK folder. The shell says command not found when that package is not installed, when its files are not inside a folder named latest, or when that bin folder is not on PATH.

  • Applies to Android SDK Command-line Tools latest, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Look for the file itself. If find prints a path, the tool exists and only PATH is wrong; if it prints nothing, the package is missing or misplaced.

    find "${ANDROID_HOME:-$HOME/Android/Sdk}" -name sdkmanager -type f 2>/dev/null
  2. 2Match what you see, then jump to its fix

    1. 1find prints .../cmdline-tools/latest/bin/sdkmanager, yet the bare command is not foundThe tool is installed but its folder is not on PATHFix
    2. 2find shows cmdline-tools/bin/sdkmanager with no latest folder in the pathThe zip was extracted but not placed in a latest folderFix
    3. 3find prints nothingThe Command-line Tools package was never downloadedFix

What does the error look like?

  • sdkmanager: command not found
  • bash: sdkmanager: command not found

Cause 1 of 3

The tool is installed but its folder is not on PATH

1Check

Android's docs say you can run the tools from cmdline-tools/latest. Printing PATH shows whether that bin folder is in it.

echo "$PATH" | tr ':' '\n' | grep -i cmdline-tools

2Fix

Set ANDROID_HOME to the SDK folder and add cmdline-tools/latest/bin and platform-tools to PATH, then put the lines in your shell startup file (~/.bashrc or ~/.zprofile).

export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools

3Verify

A new shell finds the command and lists packages.

sdkmanager --list

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

The zip was extracted but not placed in a latest folder

1Check

Android's steps: move the unzipped cmdline-tools folder into your SDK directory, create a sub-directory called latest inside it, and move the original contents (bin, lib, NOTICE.txt, source.properties) into latest.

ls "$ANDROID_HOME/cmdline-tools"

2Fix

Rebuild the layout so the files sit under cmdline-tools/latest.

cd "$ANDROID_HOME/cmdline-tools"
mkdir latest
mv bin lib NOTICE.txt source.properties latest/

3Verify

The tool runs from its full path.

"$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --version

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

The Command-line Tools package was never downloaded

1Check

Android's docs say sdkmanager is provided in the Android SDK Command-Line Tools package, which is a separate download on the Android Studio page.

ls "$ANDROID_HOME"

2Fix

Download the command-line tools package, extract it into the SDK folder, and arrange it as in the layout steps above. With Android Studio, install it from the SDK Manager instead.

# SDK Manager > SDK Tools > Android SDK Command-line Tools (latest)

3Verify

find now prints the sdkmanager path.

find "$ANDROID_HOME" -name sdkmanager -type f

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Set ANDROID_HOME in your shell startup file, not just in the current terminal.
  • Use ANDROID_HOME: Android marks ANDROID_SDK_ROOT as deprecated.
  • In scripts, pin a specific command-line tools version instead of latest.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

./gradlew will not run: permission denied

zsh: permission denied: ./gradlew

The gradlew script has lost its executable bit, usually after a zip download, a Windows checkout or a copy to another disk.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.