which method

Future<String> which(
  1. String command, {
  2. bool debug = false,
})

Implementation

Future<String> which(String command, {bool debug = false}) async {
  return _bridge.executor
      .execute([
        ..._connection.arguments,
        'shell',
        'which',
        command,
      ], debug: debug)
      .then((result) {
        final string = result.stdout.toString().trim();
        if (result.exitCode != 0 || string.isEmpty) {
          throw AdbFileNotFoundExeption(command);
        } else {
          return string;
        }
      })
      .catchError((e) {
        throw AdbFileNotFoundExeption(command);
      });
}