Typically, ADB commands work only when used with the path of the SDK Platform-tools folder in the command window. Instead of manually adding the path to the Mac Terminal before every command session, you can set up a system-wide environment. This method adds ADB to a path on Mac by setting up the PATH variable in the bash profile and allows you to access commands via the Terminal from anywhere. Get ready to enjoy global ADB on macOS without getting the ‘ADB command not found’ error.

We discussed 2 methods for using ADB on a Mac computer.

Table of Content

1. Adding ADB to Path in Bash Profile

Do the following to enjoy global access to the ADB command-line tool right after launching the Mac Terminal.

  1. Download the latest Android SDK Platform-tools that contain ADB and Fastboot drivers for Mac. Extract the downloaded zip to get a folder named ‘platform-tools‘.
  2. Now open the Home directory on your Mac. If you don’t know how to do that, there are 3 ways to open it.
    • Press Command+Shift+H on your keyboard.
    • Press Command+Shift+G and enter ‘~/’.
    • Double-click the Macintosh HD icon on your desktop. Now click Users > Home icon.
    • Click the Go tab in the Finder bar and select Home.open home directory mac os
  3. Create a new folder called ‘android-sdk-macosx‘ in the Home directory. You can rename it as ‘ADB’ or ‘AndroidSDK’ too.
  4. Right-click the ‘platform-tools‘ folder icon and select the Copy “platform-tools” option from the context menu.
  5. Paste the ‘platform-tools‘ folder into the new folder you created. You can move this folder to any other location where you won’t accidentally delete them. I moved it to the root of my Macbook Pro’s storage.adb fastboot files mac os
  6. Launch the Mac Terminal app from Finder > Go > Utilities.mac terminal
  7. When the Terminal is open, type the following command and press Enter. To avoid typos, copy and paste the command into the Terminal window. Learn how to copy the folder path on Mac to ensure you use the correct path of the ‘platform-tools‘ folder in the command line.
    echo 'export PATH=$PATH:~/android-sdk-macosx/platform-tools/' >> ~/.bash_profile

    adding adb path to mac bash profile

  8. If you moved ‘platform-tools’ to the Home directory, you can use the following command after replacing the username with yours.
    echo 'export PATH=$PATH:~/Users/rakeshshukla/platform-tools/' >> ~/.bash_profile
  9. Now that the ADB PATH variable has been added to your bash profile, reload it using the following command. Alternatively, you can close the Terminal window and re-launch it.
    source ~/.bash_profile

    reload adb path variable bash profile mac

  10. To check the current value of the PATH variable, use the following command.
    echo $PATH
  11. Having added ADB to the path, it’s time to verify that you have set it up properly. Just type adb or adb devices in the Terminal and hit the Enter key.adb devices command mac terminal
  12. If you get the ‘adb: command not found’ error on your Mac while attempting commands, you might have made a mistake during the setup.

2. Add Terminal Shortcut to Platform-Tools

This is the easiest method to add a folder path to the Mac terminal. However, it doesn’t provide global or system-wide ADB support as the above method does.

  1. Open System Preferences on your Mac.
  2. Click on Keyboard.mac os system preferences
  3. On the next screen, click Shortcuts and select Services from the left pane.
  4. Now, look for Files and Folders in the right pane and enable New Terminal at Folder.
  5. The shortcut will be added to the folder context menu. You can close the System Preferences window.
  6. Right-click the ‘platform-tools‘ folder icon and select the New Terminal at Folder option.open adb in mac terminal
  7. Now, you can run any ADB and Fastboot command directly when the Terminal window launches.

    adb devices command in terminal mac
    List of ADB devices in Mac Terminal

If you want to explore the capabilities of ADB, check out these ADB Shell commands.

Was this Article helpful?
YesNo