'adb' is not recognized as an internal or external command, operable program or batch file
Categories:
'adb' is not recognized: Troubleshooting Android Debug Bridge Command Not Found

Learn how to fix the common 'adb' command not recognized error on Windows, macOS, and Linux by correctly setting up your Android SDK platform tools path.
Encountering the error message "'adb' is not recognized as an internal or external command, operable program or batch file" is a common frustration for Android developers and users trying to interact with their devices via the Android Debug Bridge (ADB). This usually means your operating system cannot find the adb
executable in its defined system paths. This article will guide you through the necessary steps to resolve this issue across different operating systems.
Understanding the 'adb' Command Not Found Error
The Android Debug Bridge (ADB) is a versatile command-line tool that lets you communicate with an emulator instance or connected Android device. It's part of the Android SDK Platform-Tools package. When your system reports that adb
is not recognized, it simply means that the directory containing the adb.exe
(Windows) or adb
(macOS/Linux) file is not included in your system's PATH environment variable. The PATH variable tells your operating system where to look for executable programs when you type a command in the terminal or command prompt.
flowchart TD A[User types 'adb' in terminal] B{Is 'adb' in PATH environment variable?} C[System searches PATH directories] D[Executable found] E[Command executed] F[Executable not found] G["'adb' is not recognized" error] A --> B B -- Yes --> C C --> D D --> E B -- No --> F F --> G
Flowchart illustrating the process of command execution and the 'not recognized' error.
Step 1: Install Android SDK Platform-Tools
Before you can add adb
to your PATH, you need to ensure it's actually installed on your system. The adb
executable is part of the Android SDK Platform-Tools. If you have Android Studio installed, these tools are usually downloaded automatically. If not, or if you prefer a standalone installation, you can download them directly.
1. Download Platform-Tools
Visit the official Android Developers website to download the latest Android SDK Platform-Tools package for your operating system. The download will be a ZIP archive.
2. Extract the Archive
Extract the contents of the downloaded ZIP file to a memorable and easily accessible location on your computer. A common practice is to create a folder like C:\Android\sdk\platform-tools
on Windows, or ~/Android/sdk/platform-tools
on macOS/Linux. Make sure the platform-tools
folder itself contains the adb
executable.
C:\Users\YOUR_USERNAME\AppData\Local\Android\sdk\platform-tools
on Windows, or ~/Library/Android/sdk/platform-tools
on macOS, or ~/Android/Sdk/platform-tools
on Linux. You can use this existing path if you prefer.Step 2: Add 'adb' to Your System's PATH Environment Variable
This is the crucial step that tells your operating system where to find the adb
command. The process varies slightly depending on your OS.
Windows
- Search for "Environment Variables" in the Windows search bar and select "Edit the system environment variables."
- In the System Properties window, click the "Environment Variables..." button.
- Under "System variables," find the
Path
variable and select it, then click "Edit." - In the "Edit environment variable" window, click "New" and add the full path to your
platform-tools
directory (e.g.,C:\Android\sdk\platform-tools
). - Click "OK" on all open windows to save the changes.
- Important: Close and reopen any Command Prompt or PowerShell windows for the changes to take effect.
macOS / Linux
- Open your terminal.
- Determine your shell. Most modern macOS/Linux systems use Zsh or Bash. You can check with
echo $SHELL
. - Edit your shell's configuration file:
- For Zsh:
nano ~/.zshrc
- For Bash:
nano ~/.bash_profile
(macOS) ornano ~/.bashrc
(Linux)
- For Zsh:
- Add the following line to the end of the file, replacing
/path/to/your/platform-tools
with the actual path where you extracted theplatform-tools
folder:export PATH=$PATH:/path/to/your/platform-tools
- Save the file (Ctrl+O, then Enter for nano) and exit the editor (Ctrl+X for nano).
- Apply the changes by sourcing the file:
- For Zsh:
source ~/.zshrc
- For Bash:
source ~/.bash_profile
orsource ~/.bashrc
- For Zsh:
- Important: Close and reopen your terminal for the changes to take full effect.
Step 3: Verify the Installation
After modifying your PATH environment variable, it's essential to verify that the system can now recognize the adb
command.
1. Open a New Terminal/Command Prompt
Ensure you open a completely new terminal or command prompt window. Existing windows might not pick up the updated PATH variable.
2. Run the 'adb version' Command
Type adb version
and press Enter. If the setup was successful, you should see output similar to this, indicating the ADB version:
Android Debug Bridge version 1.0.41
Version 34.0.5-10900879
Installed as C:\Android\sdk\platform-tools\adb.exe
If you still get the "not recognized" error, double-check your path entry for typos and ensure you've restarted your terminal.
Troubleshooting Common Issues
If you're still facing problems, consider these common pitfalls:
- Typos in the Path: Even a small typo in the directory path or the environment variable name can prevent it from working. Double-check every character.
- Incorrect Directory: Ensure you're pointing to the
platform-tools
directory itself, not a parent directory or a subdirectory withinplatform-tools
. - Not Restarting Terminal: This is a very common mistake. Environment variable changes are usually applied to new processes, so existing terminal windows won't see them.
- Multiple Android SDK Installations: If you have multiple Android SDKs, ensure your PATH points to the
platform-tools
of the SDK you intend to use. - Permissions: On Linux/macOS, ensure the
adb
executable has execute permissions (chmod +x /path/to/your/platform-tools/adb
). This is rarely an issue if downloaded from the official source, but worth checking.
adb devices
After successful setup, use adb devices
to list connected devices.