Android Studio/Emulator on macOS with ARM CPU M1
AndroidMacosAndroid EmulatorHardware AccelerationMacos Big-SurAndroid Problem Overview
I started Android Studio 4.1
in macOS Big Sure 11.0.1
with new ARM cpu M1
After installing Rosetta: Yes, it builds !
But the Emulator has problems, it shows me CPU does not support VT-x
Even ARM images have this issue
I used the most recent, a very old api25 (Google has to do here something) but it's increadible slow
How to make the Emulator work and fast ?
Android Solutions
Solution 1 - Android
Good news !
Edit on 28th July 2021
> Apple Silicon Support
Now, there is an arm64 release version available for Android Studio Arctic Fox (2020.3.1) You can download it here https://developer.android.com/studio#downloads
Use a arm64-v8a image !
- Tools -> SDK Manager
- Install Android 11 (R) or 12.0 (S) and click Apply
- Tools -> AVD Manager -> click Create Virtual Device
- Choose any device that has the Play button and click Next
- Choose an arm64-v8a on "Other Images" tab
-
When NDK runs into
Unknown host CPU architecture: arm64
you can solve it here -
Solved https://stackoverflow.com/a/68285501/1079990kapt
doesn't work
End of beta ! Thank you
Edit on May 2021
> Apple Silicon Support
There is an arm64 version available for Android Studio Arctic Fox (2020.3.1) Canary 15 ... RC01 You can download it here https://developer.android.com/studio/archive
Edit on 4th Feb 2021
Now audio in and out works properly https://github.com/741g/android-emulator-m1-preview/issues/10#issuecomment-773532762
Solution 2 - Android
This fixed my issue
Tools -> SDK Manager -> SDK Tools (tab) -> Deselect 'Android Emulator' -> OK
Now, when you try to run your app, or launch device from AVD Manager, it will give the 'Install Emulator' error -> Click Ok. This will automatically download the correct version.
Solution 3 - Android
I followed the steps that this guy talks and had good results: https://medium.com/mobile-app-development-publication/my-journey-to-setup-android-emulator-for-m1-macbook-pro-b8365321b3e7
- Go to AVD Manager
- Click "+ Create Virtual Device"
- Choose a Device definition (ex. "Pixel 4a XL")
- Click "Next"
- Click "Other images"
- Download "S" System image
- Click "Next"
- Click "Finish"
Solution 4 - Android
Steps to run your Android APP on M1
Finally my Android APP running normally on my M1 chip !
This presume you already have your environment variables set.
-
Download Android Studio Arctic Fox (2020.3.1) Link (I personally got the last I could September 1, 2021)
-
Install and open Android Studio
-
Tools -> SDK Manager
-
Check the box of Android 12.0 (S) and click Apply
... Wait until it's downloaded
-
Tools -> AVD Manager -> click Create Virtual Device
-
Choose any device that has the Play button and click Next
-
Choose the image S. If you can't find it in the Recommended tab click on Other Images
-
Final step click Next and Finish
You should now be ready to go.
Solution 5 - Android
I've had this problem with my new Macbook Pro M1 Pro (Macbook Pro 2021 14 Inch M1 Pro). after some digging around, the root of the problem was that I have transferred all my data from my old Mac (using Time Machine) which uses Intel (The other Mac is Macbook Pro 2011 13 Inch Intel), so other than a lot of apps which did not run or ran sluggishly and I had to reinstall their ARM version, the Android SDK Tools were transfered too.
So here are the simple steps to the solution:
- Launch Android Studio
- Select SDK Manager
- Go to SDK Tools tab
- Untick All the Packages, and keep them in your mind because you will retick them in the next step
- You will have a dialog something like this, Select
Apply
. This way now you've uninstalled the old packages - retick all packages (to reinstall their ARM version) and click apply, this may take some time depending on your internet speed as you are reinstalling all the packages
- Try launching the emulator now, if the problem is not fixed, try restarting Android Studio or your laptop completely, My problem was fixed without restarting though
Solution 6 - Android
If everything fails try this:
On Android Studio uncheck emulator -> tools -> Launch in a tool window
Got this from this official issue thread (by jeanlst):
https://github.com/google/android-emulator-m1-preview/issues/76#issuecomment-1023563846
Solution 7 - Android
You can now download the Android Studio Canary. In which you can run the android emulator with out any limitation of the android emulator m1 preview. In android emulator m1 preview there are issues with webview , device skin, sound etc..now you dont have to worry about that
Here is the link
Solution 8 - Android
After I install the latest AndroidStudioPreview
for Mac M1, it already included a default simulator with arm64-v8a
ABI.
However, this simulator still not loaded by AndroidStudio
When I tried to run adb
from Terminal, it shows adb: command not found
. So I config the adb
-
I set adb environment variable follow this answer
-
After that, when I run adb, I get the error
zsh: bad CPU type in executable
-
Then I fix it by
softwareupdate --install-rosetta
(follow this answer) -
Restart Terminal, then
adb
command working well -
Restart AndroidStudio, then it able to see and run app to simulator
Solution 9 - Android
Now It's available
> Apple Silicon Support
Android Studio Arctic Fox Canary 15 contains preliminary support for Apple Silicon (arm64). This version of Android Studio for this platform is still under active development, but we wanted to get a functional version out to the app developer community to get feedback. On top of the Intellij build, design tools work, and the Android Emulator works with API 30 and API S Developer Preview emulator system images.
Solution 10 - Android
For me I can run the emulator on my MacBook Pro MacOS Big Sur with ARM CPU M1 only on Android Studio Arctic Fox (2020.3.1 Beta03 and later versions) only after deleting Intel x86 Emulator Accelerator (HAXM installer).
Solution 11 - Android
It is not clear exactly what problems Google has had that they still have no way to release the M1 version. I got the DTK M1 almost a year ago. I think Google got it even earlier. Yes, there was a problem with emulation, but everything else in the IDE could definitely be done.
At least a loner did it without too much trouble. There is roughness, but the speed of work is different from sky and earth. Working with a regular Android Studio on M1 is almost impossible, and even with this refinement amateur, everything flies like lighting.
Here is the link: https://github.com/dsa28s/android-studio-apple-m1
This is an unofficial canary version of Android Studio Arctic Fox with emulators on the Apple Silicon. I'm using it and it works well in most cases.
Solution 12 - Android
This works for me with Android Studio 2020.3.1:
- Tools -> AVD Manager -> click Create Virtual Device
- Pick any one of the Hardware that has Play Store, e.g. Pixel 4
- Click
Other Images
tab, download and select the S API Level - Click Next and Finish
Then you're good to go!
I don't have any issue so far with the performance of my emulator which is nice.
Source/Credit to author of: https://medium.com/mobile-app-development-publication/my-journey-to-setup-android-emulator-for-m1-macbook-pro-b8365321b3e7
Solution 13 - Android
Android Studio now has an official production release that supports the ARM chip. 2020.3.1.26
Solution 14 - Android
For me none of the solutions worked. Tried Arctic fox, bumblebee and etc. The only thing that worked was the Dolphin canary version. As you install this version, it gives you a default emulator but it's also possible to create a new one without any issue. Of course, there could be issues (because its canary ver.) but I'm happy that I can run something at this point.
Solution 15 - Android
In the emulator window (when all emulator tabs are closed) click on "Update" link and update developer tools.