Locate ADB Executable
The "adb command not found" error occurs when your terminal can't find the ADB executable. To resolve this:
- Ensure ADB is installed on your system. It's typically located in
~/Library/Android/sdk/platform-tools
. - Verify ADB's presence by opening your terminal and typing:
cd ~/Library/Android/sdk/platform-tools/ ./adb devices
If it shows a list of devices, ADB is present. - If the error persists, edit your PATH:
- For Zsh users:
nano ~/.zprofile
- For Bash users:
nano ~/.bash_profile
export PATH=$PATH:~/Library/Android/sdk/platform-tools
- For Zsh users:
- After saving, reload your configuration:
source ~/.zprofile
orsource ~/.bash_profile
- Try
adb devices
again to confirm it's working.
Edit Shell Configuration
To make ADB accessible from any directory:
- Open your shell configuration file:
- Bash users:
nano ~/.bash_profile
- Zsh users:
nano ~/.zprofile
- Bash users:
- Add this line:
export PATH=~/Library/Android/sdk/platform-tools:$PATH
- Save the changes (CTRL+X, then Y, then Enter).
- Apply the new settings:
source ~/.bash_profile
orsource ~/.zprofile
Apply Shell Changes
After editing your shell configuration, activate the changes:
- Run:
source ~/.bash_profile
orsource ~/.zprofile
- Test the setup by running
adb devices
. Your system should now list connected devices.
Install Android SDK Platform Tools
For an easier installation process on macOS, use Homebrew:
- Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install Android platform-tools:
brew install --cask android-platform-tools
This method simplifies installation and future updates of the Android SDK Platform Tools.
Your system is now configured to use ADB commands efficiently. Remember to enable USB debugging on your Android device before connecting it to your Mac for ADB operations.
Pro Tip: For security reasons, it's recommended to turn off USB debugging and wireless debugging when you're done using ADB.
- Google Developers. Android Debug Bridge (adb). Android Developers Documentation.
- Davenport C. Nexus Tools: Open-source ADB installation tool. GitHub Repository.
- Android Open Source Project. SDK Platform Tools release notes. Android Developers Website.