Skip to content

Commit aa73578

Browse files
committed
fix(ios): support old simctl runtime output format
Earlier versions of `simctl` list devices by their runtime name(`iOS 10.2`), while Xcode 10 and later list devices by their runtime identifier (`com.apple.CoreSimulator.SimRuntime.iOS-13-0`). There are reports that people on later versions of Xcode are seeing the old format, so we support it just in case. Based on those reports, although versions of Xcode 10 are using the runtime name and not identifier, the `isAvailable` key is still present (which is new in Xcode 10).
1 parent 33a8ee0 commit aa73578

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ios/utils/simulator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function getSimulators() {
5353
const output: SimCtlOutput = JSON.parse(simctl.stdout);
5454
return output.runtimes
5555
.filter(runtime => runtime.name.indexOf('watch') === -1 && runtime.name.indexOf('tv') === -1)
56-
.map(runtime => output.devices[runtime.identifier]
56+
.map(runtime => (output.devices[runtime.identifier] || output.devices[runtime.name])
5757
.filter(device => device.isAvailable)
5858
.map(device => ({ ...device, runtime }))
5959
)

0 commit comments

Comments
 (0)