Skip to content

Add ADB wrapper (adb CLI) #279

@rmarinho

Description

@rmarinho

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

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