Monday , September 24 2018 Ausdroid » Howto Guides » How to add ADB and Fastboot to your system $PATH

2015-03-16 15.54.58

We’ve previously published a guide to setting up ADB on your Mac or Windows PC. At the end of that article I mentioned that you can add the platform-tools directory to your $PATH. What this does is allows you to simply type “adb” instead of “/Users/username/really/long/path/etc/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb”, or navigating to that directory before attempting to run the ADB or fastboot tools. Today I’ll show you how this is done.

Every operating system is slightly different, but the principle is the same. $PATH represents a list of directories in which the system will look for an executable file when it’s requested. You can add to it to make it easier to run executables without having to specify the full path to it, so adding the path to platform-tools ensures you’ll always be able to run anything in that directory.

Mac or Linux

To achieve adding the SDK Platform Tools to your $PATH for Mac or Linux you need to follow a few simple steps

  • Open up a terminal and navigate to home directory by typing cd ~
  • Create file .bash_profile by typing touch .bash_profile
  • Open the file with TextEdit by typing open -e .bash_profile
  • Insert the line into TextEdit export PATH=$PATH:/Users/username/custompath/sdk/platform-tools/
  • save file and reload file by typing source ~/.bash_profile

To check if adb was set into path type adb version, if you’ve been successful you’ll see something like this
Screen Shot 2015-03-16 at 4.08.05 pm

Windows

To achieve adding the SDK Platform Tools to your $PATH for Windows you need to follow these steps courtesy of Computer Hope.

Before you start, you’ll need to know the full path to your platform-tools directory.

  • Windows 8: From the Desktop, right-click the very bottom left corner of the screen to get the Power User Task Menu. From the Power User Task Menu, click System.
    Windows Vista / Windows 7: From the Desktop, right-click the Computer icon and select Properties. If you don’t have a Computer icon on your desktop, click the Start button, right-click the Computer option in the Start menu, and select Properties.
  • Click the Advanced System Settings link in the left column.
  • In the System Properties window, click on the Advanced tab, then click the Environment Variables button near the bottom of that tab.
  • In the Environment Variables window (pictured below), highlight the Path variable in the “System variables” section and click the Edit button. Add or modify the path lines with the paths you want the computer to access. Each different directory is separated with a semicolon as shown below:
    C:\Program Files;C:\Winnt;C:\Winnt\System32
  • Add a semicolon at the end (to separate it from the previous directory), and paste the path to your platform-tools directory at the end.

winpath


You can find out more about ADB and what it can be used for on the Android Developer site.

Phil Tann   Journalist

Phil is an Android enthusiast who spends most of his time reading up on U.S. Android news so he can get the low down on what could possibly hit Australian shores. Coming from a background in IT & T sales, he’s in the perfect position to give an educated view on hardware and software.

One comment

  1. Don’t manually download adb, if you are on OS X, just use homebrew to install ‘android-sdk’ and install the platform tools and adb and fastboot will be available.

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

Review: Belkin BOOST↑UP Wireless Charging Pad

A few months ago Belkin launched their new charging pad and stand so when the …