adb command not found
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
adb: command not found means your shell cannot locate the Android Debug Bridge binary. The fix is almost always one of two things: either the Android SDK platform-tools package is not installed, or it is installed but the directory containing the adb executable is not on your shell's PATH. This guide covers both situations across macOS, Linux, and Windows, plus the edge cases that trip people up after the initial fix.
What adb Is and Where It Lives
adb (Android Debug Bridge) is a command-line tool shipped as part of the Android SDK platform-tools package. It is not a built-in operating system command. Your terminal can only find it if:
- The binary exists on disk.
- The directory containing it is listed in your shell's
PATHenvironment variable.
Default installation locations by platform:
| Platform | Typical Path |
| macOS (Android Studio) | ~/Library/Android/sdk/platform-tools/ |
| Linux (Android Studio) | ~/Android/Sdk/platform-tools/ |
| Linux (apt install) | /usr/lib/android-sdk/platform-tools/ |
| Windows (Android Studio) | C:\Users\<user>\AppData\Local\Android\Sdk\platform-tools\ |
| Homebrew (macOS) | /opt/homebrew/bin/ (symlinked) |
Step 1: Check if adb Is Installed
First, determine whether the binary exists anywhere on your system:
If that returns nothing, search for it:
If no results come back, platform-tools is not installed. Move to the installation step.
Step 2: Install Platform-Tools
You have three options depending on your setup:
Option A: Through Android Studio. Open Android Studio, go to Settings > Languages & Frameworks > Android SDK > SDK Tools, check "Android SDK Platform-Tools", and click Apply.
Option B: Standalone download. Download the platform-tools ZIP from the official Android developer site, extract it, and note the directory path.
Option C: Package manager.
The Homebrew and apt installations typically add adb to a directory already on your PATH, so you may be done after installing.
Step 3: Add platform-tools to PATH
If you installed through Android Studio or the standalone ZIP, you need to add the directory to your shell configuration.
macOS and Linux (zsh)
Reload and verify:
macOS and Linux (bash)
Windows
- Open System Properties > Advanced > Environment Variables.
- Under "User variables", find
Pathand click Edit. - Add a new entry:
C:\Users\<your-user>\AppData\Local\Android\Sdk\platform-tools - Click OK, open a new Command Prompt or PowerShell window, and run:
You must open a new terminal window. Existing windows retain the old PATH.
Step 4: Verify the Fix
After updating PATH, confirm both command resolution and device connectivity:
Expected output:
If adb version works but adb devices shows an empty list, the path problem is solved and you have a separate device connection issue (USB debugging not enabled, emulator not running, etc.).
Android Studio vs. Terminal Environment
A common point of confusion: Android Studio can find adb even when your terminal cannot. Android Studio reads the SDK path from its own internal settings (local.properties or the SDK Manager configuration), but your shell relies exclusively on PATH.
So "it works in Android Studio" does not mean your terminal is configured correctly. If you run scripts, CI pipelines, or other tools that call adb from the command line, the terminal PATH must be set up independently.
Multiple adb Installations
If you have installed platform-tools through both Android Studio and a package manager (Homebrew, apt), you may end up with two different versions of adb. This can cause confusing version mismatch errors:
Check which binary your shell resolves:
Then check if Android Studio uses a different one:
If the versions differ, either uninstall the duplicate or make sure your PATH consistently points to the version you want to use.
Using adb Without Modifying PATH
If you do not want to modify your shell configuration, you can invoke adb by its full path:
Or create a shell alias:
This works for interactive use but will not help scripts or CI pipelines that expect adb on the PATH.
Common Pitfalls
- Editing
~/.bashrcwhen your shell iszsh. On modern macOS, the default shell iszsh, which reads~/.zshrc, not~/.bashrc. Runecho $SHELLto confirm which shell you are using. - Adding the SDK root to
PATHinstead of theplatform-toolssubdirectory. Theadbbinary lives insideplatform-tools/, not at the SDK root. Adding~/Library/Android/sdkto your path will not help. - Forgetting that existing terminal windows keep the old environment. After modifying a shell config file, you must open a new terminal or run
source ~/.zshrcto pick up changes. - Having two conflicting
adbversions from Android Studio and a package manager, leading to client-server version mismatch errors. - On Linux, missing the
udevrules for USB devices. Even withadbon the path, USB-connected devices may not appear without proper permissions. Installandroid-udev-rulesor add a custom rule file.
Summary
adb: command not foundmeans the platform-tools directory is missing from yourPATHor platform-tools is not installed at all.- Install platform-tools through Android Studio, a standalone download, or your system's package manager.
- Add the
platform-toolsdirectory (not the SDK root) to your shell'sPATHand reload the configuration. - Open a new terminal after making
PATHchanges; existing sessions retain the old environment. - Verify with
adb versionandadb devicesto confirm both path resolution and device connectivity. - Watch for version conflicts if platform-tools is installed in multiple locations.
Related reading
- adb devices no permissions user in plugdev group; are your udev rules wrong?
- ADB Install Fails With INSTALL_FAILED_TEST_ONLY
- ADB No Devices Found
- adb not finding my device / phone MacOS X
- ''adb'' is not recognized as an internal or external command, operable program or batch file
- Add a body to a 404 Not Found Exception
- ADB Shell Input Events
- Add a border outside of a UIView instead of inside
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.