Mark Korzhov
Mark Korzhov

Reputation: 2159

android: command not found

I tried to make a .jar file from a cloned project:

android update project -p .

but got the error:

android: command not found

I tried to set path to Android SDK, but it didn't help:

export ANDROID_HOME=D:\java\android-sdk
export PATH=$ANDROID_HOME\tools:$PATH
export PATH=$ANDROID_HOME\platform-tools:$PATH

Is it possible to solve this problem?

UPD: I'm using Git Shell from this software: http://git-scm.com/download/win

Upvotes: 17

Views: 33502

Answers (4)

Ivan
Ivan

Reputation: 3062

Finding-android-sdk-on-mac-and-adding-to-path Finding Android SDK on Mac and adding to PATH

To fix

android: command not found error

follow two easy steps (Linux and Mac):

1) Export your Android Sdk path to the ANDROID_HOME variable

$ export ANDROID_HOME=~/Android/Sdk

(change "~" to "$HOME" on Mac)

2) Export Sdk tools path to the PATH variable

$ export PATH=$ANDROID_HOME/tools:$PATH

That's it! run

android

command again to make sure it works properly.

Upvotes: 24

David Charles
David Charles

Reputation: 557

This worked for me on ubuntu

Edit the bashrc using nano:

nano ~/.bashrc

By adding the following to the end of the file:

export ANDROID_HOME=$HOME/Android/Sdk

export PATH=$PATH:$ANDROID_HOME/tools

Exiting the nano editor:

ctrl + x , then type Y, then hit the enter key to save the changes to the .basrc file and to exit the nano editor.

The above steps would ensure that your changes remains after the terminal closes. Note, for the android command to work ensure to close the terminal and reopen a new one.

Upvotes: 3

user7498936
user7498936

Reputation:

You have to configure ANDROID_HOME environment variable.

For Mac Run this command

export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools

For Windows

Go to Control Panel → System and Security → System → Change settings → Advanced System Settings → Environment variables → New, then enter the path to your Android SDK. Variable name = ANDROID_HOME Variable path = your android sdk path.

Upvotes: 13

Anton Savin
Anton Savin

Reputation: 41301

If you run commands from windows shell (cmd.exe) you should add D:\java\android-sdk\tools and D:\java\android-sdk\platform-tools to your path via computer properties dialog.

If you run on Cygwin try export PATH=/cygdrive/d/java/android-sdk/tools:/cygdrive/d/java/android-sdk/platform-tools:${PATH}.

Upvotes: 7

Related Questions