adb
command not found
troubleshooting
Android
terminal issues

adb command not found

Master System Design with Codemia

Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.

Introduction

adb: command not found means your shell cannot locate the Android Debug Bridge executable. In practice, that usually means one of two things: platform-tools is not installed, or it is installed but the platform-tools directory is not on your shell PATH.

What adb actually is

adb is shipped with the Android SDK platform-tools package. It is not a built-in operating-system command, so the terminal only finds it if:

  • the binary exists on disk
  • your shell knows where to look for it

On most systems, the executable lives in an Android SDK directory under platform-tools.

First check: is adb installed

The quickest check is to look for the binary directly.

bash
which adb

If that prints nothing, search for the platform-tools directory.

bash
find "$HOME" -type f -name adb 2>/dev/null | head

If you cannot find it anywhere, install Android SDK platform-tools through Android Studio's SDK Manager or the standalone platform-tools package.

Add platform-tools to PATH

Once you know the directory, add it to your shell configuration.

A common macOS or Linux example for zsh is:

bash
export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk"
export PATH="$ANDROID_SDK_ROOT/platform-tools:$PATH"

Put those lines in ~/.zshrc, then reload the shell.

bash
source ~/.zshrc
adb version

If you use a different SDK location, substitute the correct path. On Linux the SDK is often under $HOME/Android/Sdk.

Typical Windows location

On Windows, the same idea applies, but you update the system Path in Environment Variables and point it to a directory such as:

text
C:\Users\your-user\AppData\Local\Android\Sdk\platform-tools

After updating the environment variables, open a new terminal window and run adb version again.

Android Studio versus shell environment

A common source of confusion is that Android Studio can find the SDK while your terminal cannot. IDEs often know the SDK path from their own settings, but your shell still depends on PATH.

So "it works in Android Studio" does not prove your terminal is configured correctly.

Verify the fix

After updating PATH, confirm both that the command resolves and that the daemon can talk to devices.

bash
adb version
adb devices

If adb version works but adb devices shows nothing, the path problem is fixed and you have moved on to a separate device-connection problem.

If you use zsh, updating only ~/.bashrc will not help your current shell. Likewise, a terminal already open before the PATH change will keep the old environment until you reload it or open a new session.

It is also worth checking that the executable bit and directory permissions are correct on Unix-like systems if the binary exists but still cannot be executed.

Common Pitfalls

A common mistake is editing the wrong shell startup file. If you use zsh, changing only ~/.bashrc will not help your current terminal setup.

Another issue is adding the SDK root itself to PATH instead of the platform-tools subdirectory. The shell needs the directory that actually contains the adb binary.

It is also easy to forget that existing terminal windows keep the old environment. Open a new shell or reload the config after making changes.

Summary

  • 'adb: command not found usually means platform-tools is missing or not on PATH.'
  • Install Android SDK platform-tools if the adb binary does not exist.
  • Add the platform-tools directory, not just the SDK root, to your shell PATH.
  • Reload the shell and verify with adb version.
  • If adb resolves but devices are missing, the remaining issue is no longer a shell-path problem.

Course illustration
Course illustration

All Rights Reserved.