Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit a8fc33f

Browse files
committed
(Livesync) Hopefully a more reliable iOS simulator app restart.
The `killall` operation wasn't always killing the process by the time we attempted the `xcrun` action. Now we wait for half a second before starting the app.
1 parent 163825e commit a8fc33f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

mobile/ios/ios-emulator-services.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,12 @@ class IosEmulatorServices implements Mobile.IiOSSimulatorService {
208208
this.$logger.trace("Unable to kill simulator: " + e);
209209
}
210210

211-
this.$childProcess.exec(`xcrun simctl launch ${runningSimulatorId} ${appIdentifier}`).wait();
211+
setTimeout(() => {
212+
// Killall doesn't always finish immediately, and the subsequent
213+
// start fails since the app is already running.
214+
// Give it some time to die before we attempt restarting.
215+
this.$childProcess.exec(`xcrun simctl launch ${runningSimulatorId} ${appIdentifier}`);
216+
}, 500);
212217
}).future<void>()();
213218
}
214219
}

0 commit comments

Comments
 (0)