Summary
Add AdbRunner class to Xamarin.Android.Tools.AndroidSdk to wrap adb CLI operations for device management.
Background
The MAUI DevTools CLI and IDE extensions need to list connected devices, start/stop the ADB server, and query device state. This functionality should live in the shared android-tools package.
Reference implementation exists in android-platform-support (internal) Mono.AndroidTools.Adb.
Proposed API Surface
`csharp
public class AdbRunner
{
Task<IReadOnlyList> GetDevicesAsync(CancellationToken ct = default);
Task StartServerAsync(CancellationToken ct = default);
Task KillServerAsync(CancellationToken ct = default);
Task WaitForDeviceAsync(string serial, CancellationToken ct = default);
}
public record AndroidDeviceInfo(string Serial, DeviceState State, string? Model, string? Product, TransportType Transport);
public enum DeviceState { Unknown, Offline, Device, NoDevice, Recovery, Sideload, Unauthorized }
public enum TransportType { Unknown, Usb, Emulator }
`
Consumer
- MAUI DevTools CLI (
maui android devices) — see MAUI DevTools Spec PR
- VS/VS Code extensions for device picker
Related
Summary
Add
AdbRunnerclass toXamarin.Android.Tools.AndroidSdkto wrapadbCLI operations for device management.Background
The MAUI DevTools CLI and IDE extensions need to list connected devices, start/stop the ADB server, and query device state. This functionality should live in the shared
android-toolspackage.Reference implementation exists in
android-platform-support(internal)Mono.AndroidTools.Adb.Proposed API Surface
`csharp
public class AdbRunner
{
Task<IReadOnlyList> GetDevicesAsync(CancellationToken ct = default);
Task StartServerAsync(CancellationToken ct = default);
Task KillServerAsync(CancellationToken ct = default);
Task WaitForDeviceAsync(string serial, CancellationToken ct = default);
}
public record AndroidDeviceInfo(string Serial, DeviceState State, string? Model, string? Product, TransportType Transport);
public enum DeviceState { Unknown, Offline, Device, NoDevice, Recovery, Sideload, Unauthorized }
public enum TransportType { Unknown, Usb, Emulator }
`
Consumer
maui android devices) — see MAUI DevTools Spec PRRelated