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
Summary
Add a method to
AvdManagerRunner(or equivalent) that lists available AVD device profiles (hardware definitions) fromavdmanager 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
AvdManagerRunnersupportsGetAvdsAsync()andCreateAvdAsync()but there's no way to programmatically enumerate the available device profiles.The
maui-labsCLI works around this by parsingavdmanager list deviceoutput directly in its own provider layer, but this should live in the sharedXamarin.Android.Tools.AndroidSdkpackage 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 deviceand return structured device profile info.Additional Context
maui-labsCLI (dotnet/maui-labs) has an implementation inProviders/Android/AvdManager.csthat could serve as referenceAvdManagerRunner.CreateAvdAsync()already accepts a device profile name, so this is the missing discovery counterpartls /skins/) would be useful but could be a separate issue