Skip to content

Commit 3720dcd

Browse files
Merge pull request #113 from telerik/vladimirov/fix-xcode10-install
fix: unable to install application every other time with Xcode 10
2 parents cec4452 + 4b6f107 commit 3720dcd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lib/iphone-simulator-xcode-simctl.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
4949

5050
this.startSimulator(options, device);
5151
if (!options.skipInstall) {
52-
this.simctl.install(device.id, applicationPath);
52+
await this.installApplication(device.id, applicationPath);
5353
}
5454

5555
return this.simctl.launch(device.id, applicationIdentifier, options);
@@ -73,8 +73,12 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
7373
return common.getInstalledApplications(deviceId);
7474
}
7575

76-
public installApplication(deviceId: string, applicationPath: string): Promise<void> {
77-
return this.simctl.install(deviceId, applicationPath);
76+
public async installApplication(deviceId: string, applicationPath: string): Promise<void> {
77+
try {
78+
await this.simctl.install(deviceId, applicationPath);
79+
} catch (err) {
80+
await this.simctl.install(deviceId, applicationPath);
81+
}
7882
}
7983

8084
public uninstallApplication(deviceId: string, appIdentifier: string): Promise<void> {
@@ -196,7 +200,7 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
196200
if (!device && options.device) {
197201
await this.verifyDevice(options.device);
198202
}
199-
203+
200204
device = device || await this.getDeviceToRun(options);
201205

202206
// In case the id is undefined, skip verification - we'll start default simulator.
@@ -259,8 +263,4 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
259263

260264
return _.find(availableDevices, { id: deviceId });
261265
}
262-
263-
private killSimulator(): void {
264-
childProcess.execSync("pkill -9 -f Simulator");
265-
}
266266
}

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.2",
3+
"version": "4.0.3",
44
"description": "",
55
"main": "./lib/ios-sim.js",
66
"scripts": {

0 commit comments

Comments
 (0)