Switch many `Device` methods to be async (#9587)
`adb` can sometimes hang, which will in turn hang the Dart isolate if
we're using `Process.runSync()`. This changes many of the `Device` methods
to return `Future<T>` in order to allow them to use the async process
methods. A future change will add timeouts to the associated calls so
that we can properly alert the user to the hung `adb` process.
This is work towards #7102, #9567
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 9baf97f..cf675ac 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -399,7 +399,7 @@
continue;
}
// Shell out so permissions on the dylib are preserved.
- runCheckedSync(<String>['/bin/cp', dylib.path, frameworksDirectory.path]);
+ await runCheckedAsync(<String>['/bin/cp', dylib.path, frameworksDirectory.path]);
}
}