Skip to content

Commit cd3a4cd

Browse files
author
Fatme
authored
Verify device id before running the simulator
1 parent f70ce58 commit cd3a4cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/iphone-simulator-xcode-simctl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,15 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
234234
}
235235

236236
public startSimulator(device?: IDevice): void {
237-
if (!device || !device.runtimeVersion || !device.fullId) {
238-
device = this.getDeviceToRun(device);
239-
}
240-
241237
// In case the id is undefined, skip verification - we'll start default simulator.
242238
if (device.id) {
243239
this.verifyDevice(device);
244240
}
245241

242+
if (!device || !device.runtimeVersion || !device.fullId) {
243+
device = this.getDeviceToRun(device);
244+
}
245+
246246
if (!this.isDeviceBooted(device)) {
247247
const isSimulatorAppRunning = this.isSimulatorAppRunning();
248248
const haveBootedDevices = this.haveBootedDevices();

0 commit comments

Comments
 (0)