pankaj pankaj - 2 months ago 12
Android Question

Not able to access adb in OS X through Terminal, "command not found"

I have installed Android SDK and Eclipse on my Mac system. I am able to program using Eclipse and have created few sample applications. But I am still not able to access

adb
through the terminal window. I have tried following command in terminal:

$ pwd
/Users/espireinfolabs/Desktop/soft/android-sdk-mac_x86/platform-tools

$ ls
NOTICE.txt dexdump llvm-rs-cc-2
aapt dx llvm-rs-cc.txt
adb lib source.properties
aidl llvm-rs-cc

$ adb --help
-bash: adb: command not found


I have also added the
ls
output so that you know in which window I am.

Answer

adb is not in your PATH.

Bash will first try to look for a binary called adb in your Path, and not in the current directory. Therefore, if you are currently in the platform-tools directory, just call

./adb --help

The dot is your current directory, and this tells Bash to use adb from there.

Otherwise, you can add platform-tools to your PATH, by placing a line like this in your ~/.profile or ~/.bash_profile, then re-starting the Terminal. On Linux, you might want to modify ~/.bashrc instead, depending on what is used.

export PATH=/Users/espireinfolabs/Desktop/soft/android-sdk-mac_x86/platform-tools:$PATH

If you've installed the platform tools somewhere else, change the path accordingly. For Android Studio on OS X, for example, you'd use the following—note the double-quotes that prevent a possible space from breaking the path syntax:

export PATH="/Users/myuser/Library/Android/sdk/platform-tools":$PATH
Comments