Hi, I am a fork from https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03.
A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.
Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.
See for brew, python3 and NodeJS on nvm see gist https://gist.github.com/agrcrobles/3d945b165871c355b6f169c317958e3e
Open JDK 14 works fine with gradle 6.x
Preferred: To install the JDKs 8 ( LTS ) AdoptOpenJDK:
# brew tap adoptopenjdk/openjdk via cask brew install adoptopenjdk/openjdk/adoptopenjdk8
Alternative: Do not follow this step if followed the step before
brew install java8
Be sure JAVA_HOME is exported on your bash profile or zshrc depending the shell in usage.
Without Android Studio
Or try Command line tools | Android
Use Command line tools or SDK Manager
Quick reminder: Have as many build tools as you want, have a single one platform tool with backwards compatibility :=)
Download and Install Command line tools for mac ( not the android studio unless I need it )
Use Homebrew to install Android dev tools: Note that Java8 is tricky since licence changed: https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac
brew install gradle brew install android-sdk
brew install ant brew install maven brew cask install android-ndk
Install all of the Android SDK components (you will be prompted to agree to license info and then this will take a while to run):
If you need to have openjdk first in your PATH run: echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc
For compilers to find openjdk you may need to set: export CPPFLAGS="-I/usr/local/opt/openjdk/include"
Be sure Intel Hardware Accelerated Execution Manager (HAXM) is properly installed.
HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor), be sure HAXM is properly installed.
Create and run virtual devices? Nga copied from https://gist.github.com/gasolin/9300f5f9276b2df884c80da3e2c54ffc
avdmanager list (find device skin id, lets use pixel 17) avdmanager create avd -f -n test -d 17 -k 'system-images;android-29;google_apis_playstore;x86_64' avdmanager list avd (or emulator -list-avds) /usr/local/share/android-sdk/emulator/emulator -avd test
SDK preferred location
sdk can be installed on /Library/Android/sdk or /usr/local/ to be sure check it by
All locations are valid ones from what I am aware of :)
Suggested: You will have to add the ANDROID_HOME to the profile configuration settings either on .zshrc, .bashrc or .bash_profile
emulator doesn't run, i am here to remind you to provide access into System Preferences - Security & Privacy
Creating an android AVD
More helpfull Resources
Unlicensed, opiniated and unofficial