diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index d67213bb11..02ec3ddda7 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -228,12 +228,12 @@ class SimControl { bool _isAnyConnected() => getConnectedDevices().isNotEmpty; - Future isInstalled(String appId) { + Future isInstalled(String deviceId, String appId) { return exitsHappyAsync([ _xcrunPath, 'simctl', 'get_app_container', - 'booted', + deviceId, appId, ]); } @@ -253,8 +253,8 @@ class SimControl { return runCheckedAsync(args); } - Future takeScreenshot(String outputPath) { - return runCheckedAsync([_xcrunPath, 'simctl', 'io', 'booted', 'screenshot', outputPath]); + Future takeScreenshot(String deviceId, String outputPath) { + return runCheckedAsync([_xcrunPath, 'simctl', 'io', deviceId, 'screenshot', outputPath]); } } @@ -340,7 +340,7 @@ class IOSSimulator extends Device { @override Future isAppInstalled(ApplicationPackage app) { - return SimControl.instance.isInstalled(app.id); + return SimControl.instance.isInstalled(id, app.id); } @override @@ -596,7 +596,7 @@ class IOSSimulator extends Device { @override Future takeScreenshot(File outputFile) { - return SimControl.instance.takeScreenshot(outputFile.path); + return SimControl.instance.takeScreenshot(id, outputFile.path); } } diff --git a/packages/flutter_tools/test/ios/simulators_test.dart b/packages/flutter_tools/test/ios/simulators_test.dart index a1a85a63c4..7bdbd5de53 100644 --- a/packages/flutter_tools/test/ios/simulators_test.dart +++ b/packages/flutter_tools/test/ios/simulators_test.dart @@ -161,7 +161,7 @@ void main() { '/usr/bin/xcrun', 'simctl', 'io', - 'booted', + 'x', 'screenshot', fs.path.join('some', 'path', 'to', 'screenshot.png'), ],