-
Notifications
You must be signed in to change notification settings - Fork 31
Description
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 = yeshw.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 returnedAvdInfo.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.