start static method

Future<ShellStreamHandle> start(
  1. Executor executor,
  2. List<String> arguments, {
  3. bool runInShell = false,
  4. bool debug = false,
})

Starts arguments with adbPath and returns a handle to the running process.

runInShell defaults to false, unlike the rest of Executor: a shell command is passed to adb shell as a single argument, and letting the host shell see it would re-split it on spaces — a loop like while true; do ...; done would arrive at the device in pieces.

Throws whatever Executor.start throws if adb cannot be run at all, so a missing or broken adb surfaces here rather than through done.

Implementation

static Future<ShellStreamHandle> start(
  Executor executor,
  List<String> arguments, {
  bool runInShell = false,
  bool debug = false,
}) async {
  if (debug) {
    debugPrint('execStream: ${executor.adbPath} ${arguments.join(' ')}');
  }
  final process = await executor.start(arguments, runInShell: runInShell);
  return ShellStreamHandle._(process, debug: debug);
}