Setting up Android Emulator in M1 Mac
By: Sai Balaji
Tags: Mac, MacBook Pro, Android App Development, Android, M1

Hello everyone in this article we are going to see how you can setup Android emulator in M1 ARM Chip Mac. Apple recently ditched Intel processors and started making their own processors, which is not new because currently Apple is switching their Mac processors for third time. First was in 1994 where they switched from Motorola to Power PC and second was in 2000s where they switched from Power PC to Intel Chips and now from Intel to M1.Since M1 Chips are based on ARM(Advanced RISC Machines ) architecture which means in RISC architecture, the instruction set of processor is simplified to reduce the execution time. It uses small and highly optimized set of instructions. And they are also power efficient. However there are several Softwares which still uses x86 architecture. So most of the third party developer tools like Android Studio,Unreal Engine,HomeBrew are not yet optimised for ARM architecture.Though Apple provide a solution by using Rosetta 2 which is a dynamic binary translation which can translate x86 instructions to ARM instructions so that Intel based apps can run in M1 Mac.However they also have some limitation.

Rosetta 2 A binary Translator

Rosetta doesn’t translate the following executables:

Kernel extensions

Virtual Machine apps that virtualize x86_64 computer platforms

Here the Virtual Machine apps includes all VM software like Virtual Box,Android emulator etc.

What about Android Studio?

Currently Android Studio native ARM build is not available which means entire Android Studio runs with Rosetta 2 translation which gives pretty much impressive performance than intel based Mac.

But If you try to launch your virtual machine it will show the following error.

You can debug your App with a physical device connected to Android Studio.

But sometimes If you don’t have access to a physical device you can use Android emulator which is specifically made for M1 chips which is still under preview.I doesn’t comes bundled with Android Studio.

Setting up Android Emulator for M1 Chips

Head on to Android Emulator M1 Preview repo by Google which is still under beta but it works fine but with some exceptions which is mentioned in the readme file of that repo.

Click on releases option and download the latest preview version by clicking of android emulator m1 preview.dmg.

It will download a DMG file.

Click on the DMG file in downloads folder of your Mac.

However as usual Mac OS GateKeeper will verify this DMG file before executing it select skip option to bypass the verification process because Mac OS will report an error and prevent the file from executing

Then as usual click and drag the emulator into Application folder.Now if you open Application folder in your Finder you can see a new Application without icon it is our Android Emulator.

Further if it shows some warning then go to settings and click open anyway.

Double click on it and wait for it the emulator to launch. It may show the following warning and you can set it up as shown in the waring message. In our case we can skip it now by pressing Ok.

And here we have Android emulator running natively on M1 Chip

A test run with Android Studio

Now open an existing project or create a new project in android studio.

As you can see in AVD option shows a new emulator with name Virtual Device which is our M1 Android Emulator.

Press the run button now it will build the project and deploy it in your AVD.

All set! Now we have an AVD running natively on M1 Chip although there are some issues which will be resolved in future releases. Other AVD like TV,watch will be released later as Google dev team is working on it.

Thanks for Reading!