Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i run the Android command line tools?

I'm still pretty new to Android and programming in general, and I can't seem to get the command line tools packaged with the Android SDK to work. I'm running Mac OSX and each time I try to run layoutopt, for example, the terminal returns, *-bash: cmd: command not found *

Also, is it okay to have my SDK located in the Developer directory and my android project in some unrelated directory when using these tools?

like image 694
Sachin Avatar asked Jun 07 '10 21:06

Sachin


People also ask

Where are android command-line tools installed?

You can install and update each package using Android Studio's SDK Manager or the sdkmanager command-line tool. All of the packages are downloaded into your Android SDK directory, which you can locate as follows: In Android Studio, click File > Project Structure. Select SDK Location in the left pane.

What is Android SDK command-line tool?

The sdkmanager is a command-line tool that lets you view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you don't need to use this tool, and you can instead manage your SDK packages from the IDE.


2 Answers

If you want you can put the path in your ~/.bash_profile so you can call it from anywhere:

export ANDROID_HOME=/Users/<username>/path/to/sdk/tools

export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
like image 50
NKijak Avatar answered Sep 27 '22 18:09

NKijak


You may want to include also the platform-tools into your ~./bash_profile

### Android dev tools
export ANDROID_HOME="/Users/myusername/DEV/tools/adt-bundle-mac-x86_64/sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"

You will need to start a new terminal session or run

source ~/.bash_profile

to loads the values immediately without having to open a new terminal session.

like image 43
jgatjens Avatar answered Sep 27 '22 18:09

jgatjens