Extract all libimobiledevice invocations to IMobileDevice class (#10793)
Moves all remaining calls to tools that are part of the libimobiledevice
suite of tools to the IMobileDevice class. This allows for better
tracking of this dependency, and easier mocking in tests.
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index a646650..7d1bfa6 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -84,6 +84,14 @@
String getInfoForDevice(String deviceID, String key) {
return runSync(<String>['ideviceinfo', '-k', key, '-u', deviceID]).trim();
}
+
+ /// Starts `idevicesyslog` and returns the running process.
+ Future<Process> startLogger() => runCommand(<String>['idevicesyslog']);
+
+ /// Captures a screenshot to the specified outputfile.
+ Future<Null> takeScreenshot(File outputFile) {
+ return runCheckedAsync(<String>['idevicescreenshot', outputFile.path]);
+ }
}
class Xcode {