4

I cannot figure out how to get my Android command line tools to work. I had run the following commands, but when I type in Android avd, the output is bash: android: command not found. Does anyone have any advice on how to get the Android command line tools to work? I have installed the SDK, etc. I am not sure what to do.

export Android_Home=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools
export PATH=$PATH:$ANDROID_HOME/tools
Jonik
  • 80,077
  • 70
  • 264
  • 372
user2600095
  • 103
  • 1
  • 1
  • 9

3 Answers3

10

One obvious problem with this:

export Android_Home=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools
export PATH=$PATH:$ANDROID_HOME/tools

...is that Android_Home is not the same as ANDROID_HOME. Environment variable names on Mac OS X (and other Unix systems) are case-sensitive. Try:

export ANDROID_HOME= ...

Next, in a comment OP wrote:

I can't find .bash_profile

Well, you just have to create it under your home directory. Open a Terminal, and type:

nano ~/.bash_profile 

Additionally, I think in

export ANDROID_HOME=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools

... the /tools bit is too much. SDK home should be just /Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/, then in PATH you want to have $ANDROID_HOME/tools.

Jonik
  • 80,077
  • 70
  • 264
  • 372
  • I got it to work. Once I took @Jonik's advice and changed to tools, not platform_tools. Thanks everyone! – user2600095 Nov 24 '13 at 20:46
  • export Android_Home=/Users/username/Downloads/adt-bundle-mac-x86_64-20131030/sdk/tools export PATH=$PATH:$ANDROID_HOME/tools android updated project -t 1 -p . above lines worked for me... – Noundla Sandeep Mar 19 '14 at 13:05
4

This is working on my osx system. Apply your paths correctly.

export ANDROID_HOME=/Users/nathansire/Library/Android/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH

Remember to run source to apply changes from ~/.bash_profile

source .bash_profile
Natus Drew
  • 1,876
  • 1
  • 21
  • 23
0

Just change

export Android_Home=/ Users/username/Downloads/ adt-bundle-mac- x86_64-20131030/sdk/tools export PATH=$PATH: $ANDROID_HOME/tools

to

export ANDROID_HOME=/ Users/username/Downloads/ adt-bundle-mac- x86_64-20131030/sdk/platform-tools export PATH=$PATH: $ANDROID_HOME/platform-tools

VishalKale
  • 758
  • 7
  • 22