I tried everything and I am running out of ideas to have an Android simulator working on my mac.
- I downloaded —again— Android studio from the official website
...same result.
I can't make the virtual device works on my machine.
I always have this device manager error when I try to launch the simulator.
Question:
How can I have an android simulator working with an Apple M1?
CodePudding user response:
What works for me:
- Install Android Studio from the official webpage for M1 processors and then install Android SDK in default location
~/Library/Android/sdk
. - Install java using brew - brew install openjdk@11 (android supports java 11, no needs for installing java 17 etc.) and then add it to the path.
- Set your android paths in zsh or bash:
# Path to Android SDK export ANDROID_HOME=/Users/$USER/Library/Android/sdk export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/ndk-bundle:$PATH"
- Install the emulator image for arm --> arm64-v8a (from Android Studio's Device Manager).
- Done - it should be working. I use M1 processor and the emulator works just fine. You don't need any m1-emulator-preview from github.
Edit: you can check this thread as well: Android Studio/Emulator on macOS with ARM CPU M1
CodePudding user response:
I was having the same issue. Following the instructions in https://stackoverflow.com/a/71620742 resolved it for me.
- Install Android Studio from the official webpage for M1 processors and then install Android SDK in default location