Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raftheunis87/f829f9cbf8dcef4959742e78c40f8f4a to your computer and use it in GitHub Desktop.
Save raftheunis87/f829f9cbf8dcef4959742e78c40f8f4a to your computer and use it in GitHub Desktop.
Setup Android Development Environment on a Mac

Prerequisites:

  • XCode is installed (via the App Store)
  • XCode Command Line Tools are installed (xcode-select --install in Terminal/iTerm)
  • Java

Install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

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

brew doctor

Install Brew Cask

brew tap caskroom/cask

Install Python 3:

brew install python3

Use Homebrew to install Android dev tools:

brew install ant
brew install maven
brew install gradle
brew cask install android-sdk

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 "platform-tools" "platforms;android-27"
sdkmanager "build-tools;27.0.3"

Finally update your environment variables:

export ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397

Update your paths (bonus points to a better solution to the hardcoded build tools version):

export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/build-tools/27.0.3:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment