otherDeviceServers function

Future<List<String>> otherDeviceServers(
  1. String serial,
  2. String adbPath, {
  3. Future<ProcessResult> run(
    1. String,
    2. List<String>
    ) = boundedRun,
})

Automation servers other tools left running on the device (app_process mains such as mobile-mcp's DeviceServer or scrcpy); they hold the accessibility and screen-capture connections glint needs.

Implementation

Future<List<String>> otherDeviceServers(String serial, String adbPath,
    {Future<ProcessResult> Function(String, List<String>) run = boundedRun}) async {
  try {
    final r = await runCapped(
      run,
      adbPath,
      ['-s', serial, 'shell', 'ps', '-A', '-o', 'ARGS'],
      timeout: const Duration(seconds: 10),
      phase: 'adb ps',
    );
    return parseDeviceServers(r.stdout as String);
  } on Object {
    return const [];
  }
}