Skip to content

Commit 0b52a9c

Browse files
Merge pull request #94 from telerik/vladimirov/fix-sim-8
Fix restarting of application on simulator with OS < 10
2 parents c0f761b + 4499d11 commit 0b52a9c

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

lib/iphone-simulator-xcode-simctl.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,20 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
9797
// Ignore the error.
9898
}
9999

100+
let resultOfTermination: string;
100101
if (xcodeMajorVersion && xcodeMajorVersion < 8) {
101102
// Xcode 7.x does not have support for `xcrun simctl terminate` command
102-
const resultOfKill = childProcess.execSync(`killall ${bundleExecutable}`, { skipError: true });
103-
// killall command does not terminate the processes immediately and we have to wait a little bit,
104-
// just to ensure all related processes and services are dead.
105-
utils.sleep(0.5);
106-
return resultOfKill;
103+
resultOfTermination = childProcess.execSync(`killall ${bundleExecutable}`, { skipError: true });
107104
} else {
108-
return this.simctl.terminate(deviceId, appIdentifier);
105+
resultOfTermination = this.simctl.terminate(deviceId, appIdentifier);
109106
}
107+
108+
// killall command does not terminate the processes immediately and we have to wait a little bit,
109+
// just to ensure all related processes and services are dead.
110+
// Same is valid for simctl terminate when Simulator's OS version is below 10.
111+
utils.sleep(0.5);
112+
113+
return resultOfTermination;
110114
} catch (e) {
111115
}
112116
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ios-sim-portable",
3-
"version": "3.1.1",
3+
"version": "3.1.2",
44
"description": "",
55
"main": "./lib/ios-sim.js",
66
"scripts": {

0 commit comments

Comments
 (0)