Repository navigation
Working Android emulator inside a macOS UTM guest on Apple Silicon without nested virtualisation (QEMU 11) #8265
Unanswered
sjgoodapps-tech
asked this question in
macOS
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I wanted to run both iOS and Android development and testing entirely inside a macOS UTM virtual machine on Apple Silicon, without running an Android emulator on the physical host.
After encountering the same problems reported in #7024, I managed to get Google's new Android emulator engine working in software mode. It boots Android in about three minutes, renders correctly, installs APKs and runs a real Android application.
I thought it was worth sharing the configuration, as I couldn't find a documented solution for this particular setup.
Environment
Tested on 6 December 2026:
Host: Apple M3 Max.
Guest: macOS 26.7 using UTM's Apple Virtualization backend.
VM allocation: 12 vCPUs and 32 GB RAM.
Android emulator allocation: 4 vCPUs and 2 GB RAM.
Android SDK command-line tools: 12.0.
Classic emulator: 37.3.10 and Canary 37.4.2, both using QEMU 2.12.
Next-generation emulator: Android Emulator (Preview) 37.1.10, using QEMU 11.0.2.
Android system images: API 35 and API 37, ARM64, userdebug builds.
The macOS guest does not expose hardware virtualisation:
Returns:
The problem
The normal Android emulator fails with:
Disabling CPU acceleration alone was insufficient with the classic emulator because it still attempted to initialise Hypervisor.framework.
I eventually got the classic emulator to boot using software CPU emulation, but it was too slow to be useful and the display remained black.
Google's new QEMU 11-based emulator was considerably more successful.
Results
Test | Classic QEMU 2.12, API 35 | New QEMU 11.0.2, API 37 -- | -- | -- Android boot | ~23 minutes | 181 seconds Graphics | Black screen | Working ADB screenshot | 86–100 seconds | 9 seconds Install ~125 MB APK | Did not complete within 6 minutes | 50 seconds Application launch | Not tested successfully | 15 seconds UI dump and tap | Not practical | A few secondsThis isn't a controlled benchmark of the two QEMU versions, since the Android system images and graphics backends also differ. These are simply the results from my machine.
The new configuration is sufficiently responsive for functional application testing, including inspecting screenshots and interacting with the application through ADB.
How to get it working
1. Install the next-generation emulator
The important discovery was that installing the Canary version of the normal
emulatorpackage did not give me QEMU 11. Canary 37.4.2 still used QEMU 2.12.The package that worked was
emulators;latest, listed as Android Emulator (Preview).I used a separate SDK directory to avoid changing my existing installation.
Adjust
EXISTING_SDKto point to your current Android SDK.Check the actual QEMU version:
My installation reported QEMU 11.0.2.
2. Make sure the SDK contains platform-tools
Without
platform-tools, the new launcher did not recognise the separate SDK root correctly.It attempted to hand over to the legacy emulator, logging:
Linking the existing platform-tools directory resolved this:
Alternatively, install platform-tools into the new SDK root.
3. Create the virtual device
My older version of
avdmanagercould not read the API 37 package metadata, so I created the AVD configuration manually.If your version of
avdmanagersupports the newer image, you may not need this step.Create:
The
test_avd.inifile contains:I copied the
config.inifrom an existing ARM64 virtual device and changed the relevant settings:4. Launch the emulator
This is the configuration that worked for me:
There are two particularly important settings:
ANDROID_I_WANT_MY_TCG=yestogether with-accel offenables software CPU emulation. The new launcher explicitly logs that it is forcing TCG.-gpu lavapipeenables software graphics rendering. Using-gpu hostcrashed because no suitable Vulkan device was available inside my macOS guest.I ran the emulator headless because my main purpose was automated application testing. I have not yet tested normal windowed operation.
5. Check Android has booted
From a separate Terminal, using the same SDK:
Then:
Once this returns
1, test graphics and application installation:I successfully installed and launched a real Jetpack Compose application and captured its rendered welcome screen.
If you need to use the classic emulator
I also found two workarounds for the older emulator engine, although its performance was insufficient for my purposes.
Disabling HVF explicitly
With the classic engine,
-accel offstill resulted in-enable-hvfbeing passed to QEMU.Adding
-feature -HVFresolved this:Interestingly,
emulator -accel-checkincorrectly reported that hardware acceleration was available in my guest.Android watchdog timeouts
The classic emulator was sufficiently slow that Android's system watchdog repeatedly killed
system_serverduring boot.The logs showed messages such as:
Android has a property intended to accommodate slow software emulators:
Passing it through the emulator's
-propargument did not work because of Android's property restrictions.On my userdebug image, I was able to set it while it was still unset using root ADB, then restart the Android framework:
This allowed Android 15 to finish booting without restarting the entire emulator or wiping its data.
The setting did not persist across emulator shutdowns.
The QEMU 11 and API 37 combination completed its initial boot without needing this workaround.
Limitations
This is software emulation, not nested hardware virtualisation.
It is useful for functional testing, but the timings are not representative of real Android devices.
Snapshot restoration has not yet been tested.
Hardware-dependent functionality still requires appropriate physical-device testing.
The next-generation emulator is a preview, so package names, flags and behaviour may change.
These results are from one machine and configuration.
References
Previous UTM issue: Nested virtualization on macOS host + macOS guest (HVF error: HV_UNSUPPORTED) #7024
Android emulator release notes: https://developer.android.com/studio/releases/emulator
Emulator command-line documentation: https://developer.android.com/studio/run/emulator-commandline
Next-generation CPU launcher source: https://android.googlesource.com/platform/hardware/generic/goldfish/+/refs/heads/emu-main-next/emulator/launcher/launch_qemu/cpu_device.cc
QEMU 11 source: https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-main-next-v11.0
Hopefully this saves someone else a few hours of trying to get Android development working inside UTM.
I'd be interested to hear whether others can reproduce this on different Apple Silicon processors and macOS versions.
All reactions