-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
With macOS 13, simulators are handled separately from Xcode. So it's possible to have a newer simulator available that's not compatible with the selected version of Xcode.
For example, iOS 17 can be available even if Xcode 14 is selected.
So when you do xcrun simctl list runtimes, iOS 17 will be listed.
This is potential problem because we use the greatest runtime from xcrun simctl list runtimes to create a simulator and run tests on it.
flutter/dev/devicelab/lib/framework/ios.dart
Lines 54 to 110 in 72aafe8
| Future<void> testWithNewIOSSimulator( | |
| String deviceName, | |
| SimulatorFunction testFunction, { | |
| String deviceTypeId = 'com.apple.CoreSimulator.SimDeviceType.iPhone-11', | |
| }) async { | |
| // Xcode 11.4 simctl create makes the runtime argument optional, and defaults to latest. | |
| // TODO(jmagman): Remove runtime parsing when devicelab upgrades to Xcode 11.4 https://github.com/flutter/flutter/issues/54889 | |
| final String availableRuntimes = await eval( | |
| 'xcrun', | |
| <String>[ | |
| 'simctl', | |
| 'list', | |
| 'runtimes', | |
| ], | |
| workingDirectory: flutterDirectory.path, | |
| ); | |
| String? iOSSimRuntime; | |
| final RegExp iOSRuntimePattern = RegExp(r'iOS .*\) - (.*)'); | |
| for (final String runtime in LineSplitter.split(availableRuntimes)) { | |
| // These seem to be in order, so allow matching multiple lines so it grabs | |
| // the last (hopefully latest) one. | |
| final RegExpMatch? iOSRuntimeMatch = iOSRuntimePattern.firstMatch(runtime); | |
| if (iOSRuntimeMatch != null) { | |
| iOSSimRuntime = iOSRuntimeMatch.group(1)!.trim(); | |
| continue; | |
| } | |
| } | |
| if (iOSSimRuntime == null) { | |
| throw 'No iOS simulator runtime found. Available runtimes:\n$availableRuntimes'; | |
| } | |
| final String deviceId = await eval( | |
| 'xcrun', | |
| <String>[ | |
| 'simctl', | |
| 'create', | |
| deviceName, | |
| deviceTypeId, | |
| iOSSimRuntime, | |
| ], | |
| workingDirectory: flutterDirectory.path, | |
| ); | |
| await eval( | |
| 'xcrun', | |
| <String>[ | |
| 'simctl', | |
| 'boot', | |
| deviceId, | |
| ], | |
| workingDirectory: flutterDirectory.path, | |
| ); | |
| await testFunction(deviceId); | |
| } |
For Xcode 14, we want an iOS 16 simulator to be used, not iOS 17.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team