Problem
When creating an AVD via AvdManagerRunner.GetOrCreateAvdAsync(), the resulting config.ini has hw.gpu.enabled = no by default. This causes the emulator to show a black screen and fail to boot on newer API levels (36+), because SurfaceFlinger requires GPU support.
Expected Behavior
After AVD creation, patch config.ini to set:
hw.gpu.enabled = yes
hw.gpu.mode = auto (already default)
This matches what dotnet/android's CreateAndroidEmulator.cs MSBuild task does — it patches RAM size and disk partition after creation.
Proposed Solution
Add a post-creation config patching step in GetOrCreateAvdAsync() that:
- Locates the created AVD's
config.ini (from the returned AvdInfo.Path)
- Sets
hw.gpu.enabled = yes
- Optionally allows callers to provide additional config overrides (e.g., RAM size, disk partition size)
Context
Discovered while debugging emulator boot failures with API 36 system images. The emulator starts but SurfaceFlingerAIDL service can't initialize without GPU → sys.boot_completed never becomes 1 → pm install fails with Can't find service: package.
Problem
When creating an AVD via
AvdManagerRunner.GetOrCreateAvdAsync(), the resultingconfig.inihashw.gpu.enabled = noby default. This causes the emulator to show a black screen and fail to boot on newer API levels (36+), because SurfaceFlinger requires GPU support.Expected Behavior
After AVD creation, patch
config.inito set:hw.gpu.enabled = yeshw.gpu.mode = auto(already default)This matches what
dotnet/android'sCreateAndroidEmulator.csMSBuild task does — it patches RAM size and disk partition after creation.Proposed Solution
Add a post-creation config patching step in
GetOrCreateAvdAsync()that:config.ini(from the returnedAvdInfo.Path)hw.gpu.enabled = yesContext
Discovered while debugging emulator boot failures with API 36 system images. The emulator starts but SurfaceFlingerAIDL service can't initialize without GPU →
sys.boot_completednever becomes1→pm installfails withCan't find service: package.