Last active
November 14, 2022 17:44
-
-
Save spilth/e7385e7f5153f76cca40a192be35f4ba to your computer and use it in GitHub Desktop.
Android Emulator with Homebrew
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch ~/.android/repositories.cfg | |
brew cask install caskroom/versions/java8 | |
brew cask install android-sdk | |
brew cask install intel-haxm | |
brew install qt | |
export ANDROID_SDK_ROOT="/usr/local/share/android-sdk" | |
sdkmanager "platform-tools" "platforms;android-27" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;27.0.0" "system-images;android-27;google_apis;x86" "emulator" | |
avdmanager create avd -n test -k "system-images;android-27;google_apis;x86" | |
/usr/local/share/android-sdk/tools/emulator -avd test |
$/usr/local/share/android-sdk/tools/emulator -avd test
PANIC: Missing emulator engine program for 'x86' CPU.
Fix the emulator
path to /usr/local/share/android-sdk/emulator/emulator
if you are using new android sdks
We may also need to run ./sdkmanager --update
after installing brew cask install android-sdk
, otherwise it will say your emulator is outdated.
For anyone curious, installing QT is not necessary here as @spilth mentioned; omitting that line seems to not cause any negative effects when running the emulator.
Yes for me I had to fix emulator path:
/usr/local/share/android-sdk/emulator/emulator -avd test
Java 8 is no longer available due to Oracle licensing.
Use alternative JDK e.g. brew cask install homebrew/cask-versions/adoptopenjdk8
To get updates for older java versions on brew cask upgrade, I recommend to enable the versions tap:
brew tap homebrew/cask-versions
brew install zulu8 # or adoptopenjdk8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"--tag google_apis" works!