sdkmanager command not found after installing the Android SDK
sdkmanager: command not foundShort 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.
Fix it fast
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/null2Match what you see, then jump to its fix
- 1
find prints .../cmdline-tools/latest/bin/sdkmanager, yet the bare command is not foundThe tool is installed but its folder is not on PATHFix - 2
find shows cmdline-tools/bin/sdkmanager with no latest folder in the pathThe zip was extracted but not placed in a latest folderFix - 3
find prints nothingThe Command-line Tools package was never downloadedFix
- 1
What does the error look like?
sdkmanager: command not foundbash: 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-tools2Fix
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-tools3Verify
A new shell finds the command and lists packages.
sdkmanager --listConfirmed by developer.android.com
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" --versionConfirmed by developer.android.com
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 fConfirmed by developer.android.com
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
sdkmanager says it could not determine the SDK root
Could not determine SDK root.
sdkmanager works out the SDK root from the folder it sits in.
2 causes, each with a fixMobile apps
Gradle will not install an Android SDK package until you accept its licence
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Gradle tried to download an SDK package, but the licence for it is not recorded on this machine.
3 causes, each with a fixMobile apps
The shell says gradlew: command not found
bash: gradlew: command not found
The shell cannot find a launcher called gradlew.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fix