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?
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.
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.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With