OS X
adb
Terminal
command not found
troubleshooting

Not able to access adb in OS X through Terminal, 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

When Terminal says adb: command not found, macOS is not finding the Android Debug Bridge executable on your shell path. The fix is usually one of two things: install Android platform-tools if adb is missing, or add the platform-tools directory to PATH if adb already exists on disk.

Verify Whether adb Is Installed

Start by checking whether the binary exists anywhere obvious. If you already have Android Studio or the command-line tools installed, adb is often under the Android SDK directory.

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

A common location is:

bash
$HOME/Library/Android/sdk/platform-tools/adb

If the search returns nothing useful, install platform-tools first.

Install Android Platform-Tools

If you use Homebrew, installation is simple:

bash
brew install android-platform-tools
adb version

If you use the Android SDK directly, install platform-tools through Android Studio or the SDK manager. Once installed, verify that the binary works by running it with its full path.

bash
$HOME/Library/Android/sdk/platform-tools/adb version

If the full path works, the problem is not installation. It is just shell configuration.

Add adb to Your PATH

Modern macOS shells usually use zsh, so the place to configure PATH is often ~/.zshrc.

bash
echo 'export PATH="$HOME/Library/Android/sdk/platform-tools:$PATH"' >> ~/.zshrc
source ~/.zshrc
adb version

If you still use bash, add the same line to ~/.bash_profile or ~/.bashrc instead.

You can inspect your current path with:

bash
echo $PATH

That helps confirm whether the platform-tools directory is present.

Why the Full Path Works but the Command Fails

The shell searches directories listed in PATH from left to right. If the directory containing adb is not included, typing adb alone cannot succeed even though the file exists.

That is why this works:

bash
$HOME/Library/Android/sdk/platform-tools/adb devices

while this fails before the path is configured:

bash
adb devices

It is the same executable. Only the discovery mechanism is different.

Check Permissions and Shell Startup Files

If adb still fails after updating PATH, confirm that you edited the startup file used by your actual shell.

bash
echo $SHELL

If the shell is /bin/zsh, updating only ~/.bash_profile will not help new zsh sessions. Likewise, if Terminal starts a login shell, one startup file may load while another does not.

Also make sure the adb file is executable:

bash
ls -l "$HOME/Library/Android/sdk/platform-tools/adb"

The output should include execute permission bits.

Test with a Real Device Command

Once adb is on the path, verify the full workflow.

bash
adb start-server
adb devices

If the command works but shows no devices, the original shell problem is fixed and you can move on to USB debugging, cable, or authorization issues separately.

Common Pitfalls

A common mistake is installing Android Studio and assuming adb is automatically available in every Terminal session. The IDE can use the SDK without your shell knowing where it lives.

Another issue is editing the wrong shell profile file. On modern macOS, ~/.zshrc is the usual choice, not ~/.bash_profile.

Developers also sometimes solve the problem in one Terminal window and forget to reload the shell or open a new session, so the new PATH never takes effect.

Summary

  • 'adb: command not found usually means either missing platform-tools or a missing path entry.'
  • Check whether adb exists under the Android SDK or install it with Homebrew or the SDK tools.
  • Add the platform-tools directory to PATH in the correct shell startup file.
  • Reload the shell and verify with adb version.
  • Once the command resolves, device-detection problems are a separate issue.

Course illustration
Course illustration

All Rights Reserved.