HomeAppsMaking the Android SDK Tools Command-line Accessible

Making the Android SDK Tools Command-line Accessible

Must Read

Most of the time, the underlying tools of the Android SDK will be accessed from within the Android Studio environment. That being said, however, there will also be instances where it will be useful to be able to invoke those tools from a command prompt or terminal window. In order for the operating system on which you are developing to be able to find these tools, it will be necessary to add them to the system’s PATH environment variable. Regardless of operating system, the PATH variable needs to be configured to include the following paths (where represents the file system location into which the Android SDK was installed):

/sdk/tools /sdk/platform-tools The location of the SDK on your system can be identified by launching the Standalone SDK Manager and referring to the Android SDK Location: field located at the top of the settings panel as highlighted in Figure 2-9: Figure 2-9 Once the location of the SDK has been identified, the steps to add this to the PATH variable are operating system dependent: 2.8.1 Windows 7

1. Right-click on Computer in the desktop start menu and select Properties from the resulting menu.

2. In the properties panel, select the Advanced System Settings link and, in the resulting dialog, click on the Environment Variables… button.

3. In the Environment Variables dialog, locate the Path variable in the System variables list, select it and click on Edit…. Locate the end of the current variable value string and append the path to the Android platform tools to the end, using a semicolon to separate the path from the preceding values. For example, assuming the Android SDK was installed into C:\Users\demo\AppData\Local\Android\sdk, the following would be appended to the end of the current Path value:

;C:\Users\demo\AppData\Local\Android\sdk\platformtools;C:\Users\demo\AppData\Local\Android\sdk\tools

4. Click on OK in each dialog box and close the system properties control panel. Once the above steps are complete, verify that the path is correctly set by opening a Command Prompt window (Start -> All Programs -> Accessories -> Command Prompt) and at the prompt enter: echo %Path% The returned path variable value should include the paths to the Android SDK platform tools folders.

Verify that the platform-tools value is correct by attempting to run the adb tool as follows: adb The tool should output a list of command line options when executed. Similarly, check the tools path setting by attempting to launch the Android SDK Manager:

Android In the event that a message similar to the following message appears for one or both of the commands, it is most likely that an incorrect path was appended to the Path environment variable: ‘adb’ is not recognized as an internal or external command, operable program or batch file.

tainies online is a fantastic venue for seeing Greek films of all kinds.

Categories