Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Android Simulator

Install Android SDK on macOS

Install homebrew https://brew.sh/

brew cask install homebrew/cask-versions/adoptopenjdk8
brew cask install android-sdk

add path in ~/.bash_profile or ~/.extra

export ANDROID_SDK_ROOT=/usr/local/share/android-sdk
export PATH=$ANDROID_SDK_ROOT/emulator:$PATH:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/build-tools/$(ls $ANDROID_HOME/build-tools | sort | tail -1)

Download related packages

touch ~/.android/repositories.cfg
yes | sdkmanager --licenses
sdkmanager --update
sdkmanager --no_https --install emulator
sdkmanager --no_https --install platform-tools
sdkmanager --no_https --install 'system-images;android-29;google_apis_playstore;x86_64'
sdkmanager --no_https --install 'extras;intel;Hardware_Accelerated_Execution_Manager'
sdkmanager --no_https --install 'build-tools;29.0.2'
sdkmanager --no_https --install 'platforms;android-29'
sdkmanager --list

Create a visual device (AVD) via avdmanager command

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)

Run AVD

emulator @test

Delete a visual device (AVD)

avdmanager delete avd -n test
@rarean

This comment has been minimized.

Copy link

@rarean rarean commented Dec 31, 2019

is this a typo ? $ANDROID_SDK_ROOT/build-tools/$(ls $ANDROID_HOME/build-tools | sort | tail -1)
you have both $ANDROID_SDK_ROOT and $ANDROID_HOME referenced

@tucomel

This comment has been minimized.

Copy link

@tucomel tucomel commented Jul 28, 2020

Error ...

arthur@blackpower ~ % emulator @test
[4499086784]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/arthur/../emulator/qemu/darwin-x86_64/qemu-system-x86_64': No such file or directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment