DeviceManager Singleton

The single source of truth for which device to target. All ADB commands in the system build their argument list using DeviceManager.instance.adbArgs.

Property Type Description
deviceIdString?Resolved target: Serial, "ip:port", or "-d"
isUsbboolIndicates if a USB device is currently targeted
isWifiboolIndicates if a Wi-Fi device is connected
adbArgsList<String>Argument list prepended to commands

Auto-Detection Logic

graph TD AppLaunch[Application Launched] --> Detect[Auto-Detect Devices] Detect --> Zero[0 Found] Detect --> One[1 Found] Detect --> Many[2+ Found] Zero --> Picker[Open ADB Manager Dialog] One --> Start[Target Device Automatically] Many --> Picker

ADB Manager Dialog

The dialog appears during pre-boot or after a connection error. It provides an immediate list of devices found via adb devices and allows for custom IP entry.

IP Connection Flow

When typing an IP, the system auto-appends :5555 if no port is specified. Success triggers an immediate Navigator.pop(deviceId) to the boot sequence.