Skip to content

Instantly share code, notes, and snippets.

@sixman9
Forked from srmds/Bare Android SDK Setup MacOS.md
Last active September 18, 2020 15:34
Show Gist options
  • Save sixman9/a5157e2e1e44e3403febe283db93fa02 to your computer and use it in GitHub Desktop.
Save sixman9/a5157e2e1e44e3403febe283db93fa02 to your computer and use it in GitHub Desktop.
Bare Android sdk setup MacOS

Bare essentials Android SDK installation, forked from: https://gist.github.com/srmds/55532e8782fb5d1f7383a78dee393ebd which itself was based on the original at https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03 . Some suggestions regarding HAXM etc. were also added.

Prerequisites:

Make sure the doctor is happy (do what it tells you):

$ brew doctor

Use Homebrew to install Android dev tools:

Optional:

$ brew install ant
$ brew install maven
$ brew install gradle

Mandatory:

$ brew install Caskroom/cask/android-sdk
$ brew install Caskroom/cask/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):

$ sdkmanager --update #instead of `android update sdk --no-ui`

Install HAXM for blazing fast emulators. Check out the "Configuring VM Acceleration on Mac" section here: http://developer.android.com/tools/devices/emulator.html

brew cask install intel-haxm

Add the following environment variables (~/.bash_profile):

export ANDROID_HOME=/usr/local/opt/android-sdk
export ANDROID_NDK_HOME=/usr/local/opt/android-ndk

If you want the latest version of the build-tools and not the most recently installed, also add this:

export PATH=$ANDROID_HOME/build-tools/$(ls $ANDROID_HOME/build-tools | sort | tail -1):$PATH

Periodically run these commands again to ensure you're staying up to date:

$ brew update
$ sdkmanager --update #instead of `android update sdk --no-ui`

Finally, install your IDE of choice, Android Studio is obviously recommended:

$ brew cask install android-studio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment