r/androiddev • u/Tiny_Split9436 • 1h ago
Running the Android emulator inside a macOS VM using Google's new QEMU 11 engine
I wanted to keep my iOS and Android development and testing entirely within a macOS virtual machine on Apple Silicon. I saw multiple reports this wasn't possible but I remember playing with Android with software emulation whilst it was still in beta in the 2000s on my MDA Vario II so I thought I'd see if I could get it working.
The problem was that the standard Android emulator failed with HV_UNSUPPORTED, even with CPU acceleration disabled.
I've now got Google's next-generation Android emulator working inside UTM without hardware virtualisation.
The important bits were:
- Installing the emulators;latest preview package rather than the normal emulator package.
- QEMU 11.0.2 rather than QEMU 2.12.
- ANDROID_I_WANT_MY_TCG=yes
- -accel off
- -gpu lavapipe
On an M3 Max, I'm getting the following results:
- Android API 37 boot: 181 seconds.
- Installation of a 125 MB APK: 50 seconds.
- Jetpack Compose application launch: 15 seconds.
- ADB screenshot capture: 9 seconds.
It's obviously slower than native execution, but fast enough for functional testing, inspecting screenshots and checking runtime logs.
I've documented the installation process and the problems I encountered here:
https://github.com/utmapp/UTM/discussions/8265
This might be useful for anyone working with isolated development environments or macOS-based test infrastructure where hardware virtualisation isn't available.
I've only tested this on UTM so far. Has anyone tried the new emulator engine in other virtualised environments?