Skip to content

Instantly share code, notes, and snippets.

@madhums
Last active October 9, 2024 22:27
Show Gist options
  • Save madhums/d5af94486f23c15acdc0b154e3c52dc0 to your computer and use it in GitHub Desktop.
Save madhums/d5af94486f23c15acdc0b154e3c52dc0 to your computer and use it in GitHub Desktop.
installing android emulator using cli on a mac

In your command line

brew install android-sdk --cask
sdkmanager "emulator"
sdkmanager "platform-tools"
sdkmanager "system-images;android-26;google_apis;x86_64"
avdmanager create avd -n NAME -k "system-images;android-26;google_apis;x86_64" # the one that you use above

In your ~/.bashrc

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 emu="$ANDROID_HOME/tools/emulator" # https://stackoverflow.com/a/43809095

In your command line

emu @NAME # the one you used above to create avd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment