I'm trying to add get the android development environment to work om my mac. I'm following this guide: https://spring.io/guides/gs/android/
I'm supposed to add the sdk to my path using:
export ANDROID_HOME=/Users/myname/Library/Android/sdk/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
however this does not give me acces to the 'android' command in the termial and when I execute $ANDROID_HOME i keep getting:
zsh: no such file or directory: /Users/myname/Library/Android/sdk/android-sdk-macosx
I've checked the path in
Android Studio>Preferences>Appearance & Behavior>System Settings>Android SDK
SDK location should be correct. What am I doing wrong?
To determine where the Android SDK folder on your computer is located open Android Studio. Press the Android Studio menu in the toolbar and search for “Android SDK” or navigate there via Appearance & Behavior, System Settings, Android SDK.
I just set up a Mac mini for work using the following steps, so I can guarantee this works with a fresh install.
1) Install Android Studio. (Standard is fine, Custom if you want to)
2) Launch Android Studio
3) From the Welcome Screen, click Configure (bottom right corner) > SDK Manager
4) Double check that you have the latest platform tools and tools installed in the SDK Tools tab.
At this point, you will have installed everything related to the android sdk, including the tools, in the default location of /Users/your-user-name/Library/Android/sdk
5) Create a .bash_profile file if you don't already have one at /Users/your-user-name
6) Add the following lines to it: (replace my username with yours)
export PATH=$PATH:/Users/chris.w.newman/Library/Android/sdk/platform-tools
export PATH=$PATH:/Users/chris.w.newman/Library/Android/sdk/tools
export ANDROID_HOME=/Users/chris.w.newman/Library/Android/sdk
By adding it to your .bash_profile, these lines will run every time you use a shell. So you don't have to worry about them ever again.
To test that everything works correctly, try the following 'which' commands from a new shell:
which adb
which android
Since these are added to the path, you should see their file path printed in the shell.
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