Skip to content

Instantly share code, notes, and snippets.

@mcarlucci
Last active February 19, 2021 23:13
Show Gist options
  • Save mcarlucci/4f086becaa7a6b072f0f3c21a13c69bf to your computer and use it in GitHub Desktop.
Save mcarlucci/4f086becaa7a6b072f0f3c21a13c69bf to your computer and use it in GitHub Desktop.
Android Emulator on Mac using Homebrew

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

In your command line

brew tap homebrew/cask-versions
brew update
brew tap homebrew/cask
brew install --cask android-sdk
sdkmanager "emulator" "platform-tools" "system-images;android-26;google_apis;x86_64"
avdmanager create avd -n NAME -k "system-images;android-26;google_apis;x86_64"

In your ~/.bashrc, ~/.bash_profile or ~/.zshrc

export ANDROID_HOME="/usr/local/share/android-sdk"
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export ANDROID_SDK_ROOT=$ANDROID_HOME
alias emulator="$ANDROID_HOME/tools/emulator" # https://stackoverflow.com/a/43809095

In your command line

source ~/.bashrc // or ~/.bash_profile or ~/.zshrc
emulate -avd NAME # the name you used above to create avd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment