Skip to content

Extend ADB device model with detailed information #29

Description

@SamratB8

Summary

Extend the current ADB device model and parser to support detailed information returned by:

adb devices -l

The detailed model should provide useful information for the WinDroid Studio device list and device-details panel while remaining compatible with basic adb devices output.

Background

Basic ADB output normally contains only:

  • Device serial
  • Device state

The -l option may also provide:

  • Product
  • Model
  • Device codename
  • Transport ID

The exact attributes may vary between devices and ADB versions. The parser must therefore treat detailed attributes as optional.

Dependencies

This issue depends on:

Tests from Issue #28 should be extended where appropriate.

Example Input

List of devices attached
emulator-5554 device product:sdk_gphone64_x86_64 model:sdk_gphone64_x86_64 device:emu64xa transport_id:1
R9CT1234567 device product:a52qxxx model:SM_A525F device:a52q transport_id:2

Proposed Model Fields

The model may include:

  • SerialNumber
  • State
  • Product
  • Model
  • DeviceName
  • TransportId
  • ConnectionType
  • IsEmulator
  • RawAttributes

The exact property names may follow current project naming conventions.

Optional information must not be represented by misleading placeholder values.

Parsing Requirements

The parser should:

  • Parse the serial number
  • Parse the connection state
  • Parse key-value attributes after the state
  • Support missing attributes
  • Ignore unknown attributes without crashing
  • Preserve unknown attributes when practical
  • Avoid depending on a fixed attribute order
  • Handle repeated whitespace
  • Handle both tabs and spaces
  • Remain compatible with basic adb devices output
  • Emulator Detection

The model may expose whether a target appears to be an emulator.

Detection should be conservative and may use indicators such as:

  • Serial beginning with emulator-
  • Known emulator transport patterns
  • Other clearly documented evidence

A device should not be marked as an emulator based only on uncertain model-name guesses.

Connection Type

Where reliably detectable, represent connection type such as:

  • USB
  • TCP/IP
  • Emulator
  • Unknown

Do not claim a connection type when the ADB output does not provide enough evidence.

Tasks

  • Extend the ADB device model
  • Update the command wrapper to support adb devices -l
  • Update the parser for key-value attributes
  • Preserve compatibility with basic output
  • Handle missing and unknown attributes
  • Add or update unit tests
  • Document nullable or optional fields
  • Avoid placing parsing logic in the WinUI project

Required Tests

Add tests for:

  • Full extended output
  • Missing model field
  • Missing product field
  • Unknown attributes
  • Attributes in different orders
  • Basic output without -l information
  • Emulator serial detection
  • Physical-device serial handling
  • Repeated whitespace
  • Malformed attributes
  • Multiple devices with different available fields

Out of Scope

This issue does not need to:

  • Query additional properties with adb shell getprop
  • Retrieve battery information
  • Retrieve Android version information
  • Retrieve screen resolution
  • Display detailed information in WinUI
  • Add device icons
  • Build a device compatibility database

Acceptance Criteria

  • Extended adb devices -l output is parsed into structured models.
  • Basic adb devices output remains supported.
  • Missing attributes do not cause exceptions.
  • Unknown attributes do not cause exceptions.
  • The parser does not depend on a fixed attribute order.
  • Emulator detection is conservative and documented.
  • Optional fields are represented safely.
  • Parser tests cover extended and basic output.
  • The full solution builds successfully in Debug and Release configurations.
  • No new compiler warnings are introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    adbWork involving Android Debug Bridge integration, device communication, commands, and diagnostics.coreShared models, configuration, abstractions, services, and reusable logic.enhancementNew feature or requesthelp wantedExtra attention is neededphase-1Work planned for the first development phase and initial usable project foundation.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions