Skip to content

AVD creation should enable GPU acceleration in config.ini #308

@rmarinho

Description

@rmarinho

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:

  1. Locates the created AVD's config.ini (from the returned AvdInfo.Path)
  2. Sets hw.gpu.enabled = yes
  3. 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 1pm install fails with Can't find service: package.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions