Skip to content

Add AvdManagerRunner.ListDeviceProfilesAsync() for AVD device profile enumeration #321

@rmarinho

Description

@rmarinho

Summary

Add a method to AvdManagerRunner (or equivalent) that lists available AVD device profiles (hardware definitions) from avdmanager list device.

Motivation

Consumers building GUI tools for Android emulator management (e.g., MAUI Sherpa, VS IDE extensions) need to present a list of device profiles (Pixel 7, Pixel Tablet, etc.) when creating new AVDs. Currently AvdManagerRunner supports GetAvdsAsync() and CreateAvdAsync() but there's no way to programmatically enumerate the available device profiles.

The maui-labs CLI works around this by parsing avdmanager list device output directly in its own provider layer, but this should live in the shared Xamarin.Android.Tools.AndroidSdk package so all consumers benefit.

Proposed API

`csharp
// In AvdManagerRunner or a new class
public record AvdDeviceProfile(string Id, string Name, string? Oem, string? Tag);

public Task<IReadOnlyList> ListDeviceProfilesAsync(
CancellationToken cancellationToken = default);
`

This would parse the output of avdmanager list device and return structured device profile info.

Additional Context

  • The maui-labs CLI (dotnet/maui-labs) has an implementation in Providers/Android/AvdManager.cs that could serve as reference
  • The existing AvdManagerRunner.CreateAvdAsync() already accepts a device profile name, so this is the missing discovery counterpart
  • Similarly, listing available skins (ls /skins/) would be useful but could be a separate issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions