AdbTool class

Thin adb executor. All argv goes through the pure constructors above; every failure is classified via classifyAdbFailure. Injectable adb path + process runner for scripted-fake tests.

Constructors

AdbTool({required String adbPath, String? serial, Future<ProcessResult> runProcess(String, List<String>)?})

Properties

adbPath → String
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serial → String?
Device serial (adb -s) — required on multi-device hosts; null lets adb pick (single-device setups only).
final

Methods

awaitVmServiceUri({Duration timeout = const Duration(seconds: 60), Duration pollInterval = const Duration(milliseconds: 500)}) → Future<VmServiceInfo?>
Bounded poll for the VM service announcement: dumps logcat every pollInterval until parseVmServiceUri matches or timeout passes. Returns null on timeout (caller decides the oka-branded failure).
clearLogcat() → Future<void>
Clears the logcat buffer (logcat -c) before a launch.
devices() → Future<List<AdbDevice>>
Lists devices (long form). Returns every entry; callers filter on AdbDevice.ready / decide the zero-or-multiple-devices error.
forwardTcp({required int devicePort, int hostPort = 0}) → Future<int>
adb forward tcp:<hostPort> tcp:<devicePort>; with hostPort 0, returns the local port adb picked (parsed from stdout).
install(String apk) → Future<void>
adb install -r. Throws AdbToolException with the classified fix on failure (adb exits non-zero OR prints Failure while exiting 0).
installMultiple(List<String> apks) → Future<void>
Installs a device-specific split set produced by bundletool.
launch(String packageName, String activity) → Future<void>
adb shell am start -n <package>/<activity>.
logcatDump() → Future<String>
Dumps the current logcat buffer (logcat -d).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited