Skip to content

Commit a88ce66

Browse files
committed
fix: xcode 10.2 compatibility for run-ios command
parse output of simulator list provided by xcode 10.2 In Xcode 10.2, the output of `xcrun simctl list --json devices` has changed to include a namespace within each version group. This commit makes a backwards-compatible adjustment to account for this change in format. To illustrate: ``` { "devices": { "iOS 10.0": [ ... ] } } ``` ``` { "devices": { "com.apple.CoreSimulator.SimRuntime.iOS 10.0": [ ... ] } } ```
1 parent b33d079 commit a88ce66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: packages/cli/src/runIOS/findMatchingSimulator.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ function findMatchingSimulator(simulators, simulatorString) {
3939
}
4040

4141
let match;
42-
for (const version in devices) {
42+
for (const versionDescriptor in devices) {
43+
const version = versionDescriptor.replace(/^com\.apple\.CoreSimulator\.SimRuntime\./g, '');
44+
4345
// Making sure the version of the simulator is an iOS or tvOS (Removes Apple Watch, etc)
4446
if (!version.startsWith('iOS') && !version.startsWith('tvOS')) {
4547
continue;

0 commit comments

Comments
 (0)