Skip to content

Commit 2816b9f

Browse files
fix: add timeout when stopping application
On slower machines, `kill -9` says its stopped the application, but it is still runing on iOS Simulator. For this cases, trying to call `launch` after that leads to error or undefined behavior. Try to fix this by calling `xcrun simctl terminate` after the kill and add half second timeout.
1 parent d737eb6 commit 2816b9f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/iphone-simulator-xcode-simctl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
105105
}
106106
} catch (e) {
107107
}
108+
109+
await this.simctl.terminate(deviceId, appIdentifier);
110+
utils.sleep(0.5);
108111
}
109112

110113
private getPid(deviceId: string, bundleExecutable: string): string {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ios-sim-portable",
3-
"version": "4.0.7",
3+
"version": "4.0.8",
44
"description": "",
55
"main": "./lib/ios-sim.js",
66
"scripts": {

0 commit comments

Comments
 (0)