Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

linux - Android - Command not found

I am trying to run the command in ubuntu

android update project --path .

However I am getting a android:command not found error.

I assume this is something to do with the path which I learnt on here the other day? I was just wondering, what do variable do I need to add (Android I assume) and what do I need to point it too.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

On MacOS/Linux, define the path to wherever you installed your SDK as ANDROID_HOME:

MacOS

$ export ANDROID_HOME=/Applications/android-sdk-macosx

If you installed Android Studio, the value will need to be

export ANDROID_HOME=$HOME/Library/Android/sdk

Linux

$ export ANDROID_HOME=~/android-sdk-linux

Then add the paths to the platform-tools and tools sub-directories (Same on MacOS/Linux).

export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH

You should now be able to run android from the shell.

If none of the suggested ANDROID_HOME paths above are valid, you can find the (uniquely and consistently named) platform-tools folder via:

find / -name platform-tools 2>/dev/null

Whatever path that returns will need to be trimmed down to end with either sdk, android-sdk-linux, or android-sdk-macosx.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...