Installing the Android SDK and Add the Android Tools To Your Path

by Stephen Fluin 2011.07.30

With every Android Software Development Kit installation, there are several key steps. The following steps will describe my recommendations regarding installation of Android SDK under Linux, and they assume that you will be integrating Android into Eclipse. The last, and most unique step is to add the Android tools to your PATH. This will enable you to run adb and other android tools more easily from the command line. It also makes it easier to use those tools with privilege escalation, such as sudo.

Recommended Android SDK Steps

  1. Download the SDK from Unarchive the tar.gz into /opt/ as /opt/android-sdk/.
  2. Install the Eclipse Tool (ADT) - Under Help in Eclipse, click on Install New Software. Add the following as a new site, and give it whatever name you wish:
  3. Configure Eclipse with SDK - Under Window->Preferences->Android, enter the SDK location, or /opt/android-sdk/ and hit OK.
  4. Add Android Tools to your PATH - Under Ubuntu, one of the best ways to add something to your PATH is to edit your ~/.bash_profile file. The line in my profile looks as follows:
PATH="/opt/android-sdk/platform-tools:${PATH}" export PATH

This file is applied any time a terminal is loaded. This will take the users existing PATH established by other system settings, and add the Android platform tools to it, and then export the variable to apply the change.

After the Android SDK is in your PATH

Because of the Linux permission system, adb often needs to be killed and restarted using root permissions so that your computer can access the USB device. I often pop open a terminal and kill and start the ADB service.

sudo adb kill-server sudo adb start-server