Is it possible to set up global ADB on Mac devices by adding an ADB variable environment? ADB command not found is a fairly common issue that Android users looking to run ADB commands on Mac devices get. Luckily for you, there is an easy way of adding ADB to a path on Mac as it can be done by setting up the PATH variable in the Bash profile and enabling universally present ADB and Fastboot. Once you’ve set up global ADB and Fastboot by adding Platform-tools or ADB to a path via a Bash profile in mac Terminal, you’ll be able to easily run ADB commands on your Mac devices.
How to set up ADB Path in Mac Terminal Bash Profile and access ADB commands
If you’re looking to enjoy global access to ADB and Fastboot command-line tools after launching the Mac Terminal, you should follow the steps mentioned below.
- Download the latest Android SDK Platform-Tools that contain ADB and Fastboot drivers for Mac. Extract the downloaded zip file to get a folder named “platform-rooms”.
- Open the Home directory on your Mac device. If you don’t know how you can do that, there are multiple ways –
- Press Command + Shift + H on the keyboard
- Press Command + Shift + G and enter “~/”
- Double-click the Macintosh HD icon on the desktop before clicking Users -> Home icon
- Click on the Go tab in the Finder bar before selecting Home
- Create a folder titled “android-sdk-macosx” in the Home directory. You can rename the folder as “ADB” or “AndroidSDK” if you want to.
- Right-click on the “platform-tools” folder icon and then select the Copy platform-tools option from the context menu.
- Now, paste the copied “platform-tools” folder into the new folder that you’ve created. You’ll be able to move it to any location you want. Move it where you won’t end up accidentally deleting it.
- Launch the Mac Terminal app by going to Finder -> Go -> Utilities.
- Once the Terminal is open, type in the command mentioned below and press the Enter key. For avoiding any typos or mistakes, you should copy and paste the command into the Terminal window. Ensure that you’re using the correct path of the platform-tools folder in the command line.
echo ‘export PATH= $PATH : ~/android-sdk-
macosx/platform-tools/ ‘ >> ~/.bash_profile
- If you’ve moved “platform-tools” to the Home directory, you can simply use this command after replacing the username with yours.
PATH = $PATH: ~ /Users/username/platform-tools/’ >> ~/.bash_profile
- Now that the ADB PATH variable is added to your bash profile, you’ll have to reload it using the below-mentioned command. Alternatively, you’ll be able to close the Terminal window and then re-launch it.
- If you wish to check the current value of the PATH variable, you’ll be able to use the following command. Otherwise, you can simply skip to the next step.
- As you’ve already added ADB to Path on your Mac, you can begin to use ADB or Fastboot commands. Now’s the time to verify that you’ve set up ADB properly on your Mac. All you have to do is type “adb” or “adb devices” in the Terminal and then hit the Enter key.
- If you get the “adb: command not found” error on your Mac device, you may have made some mistakes. Try the steps all over again and do it carefully this time.