@@ -49,7 +49,7 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
49
49
50
50
this . startSimulator ( options , device ) ;
51
51
if ( ! options . skipInstall ) {
52
- this . simctl . install ( device . id , applicationPath ) ;
52
+ await this . installApplication ( device . id , applicationPath ) ;
53
53
}
54
54
55
55
return this . simctl . launch ( device . id , applicationIdentifier , options ) ;
@@ -73,8 +73,12 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
73
73
return common . getInstalledApplications ( deviceId ) ;
74
74
}
75
75
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
+ }
78
82
}
79
83
80
84
public uninstallApplication ( deviceId : string , appIdentifier : string ) : Promise < void > {
@@ -196,7 +200,7 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
196
200
if ( ! device && options . device ) {
197
201
await this . verifyDevice ( options . device ) ;
198
202
}
199
-
203
+
200
204
device = device || await this . getDeviceToRun ( options ) ;
201
205
202
206
// In case the id is undefined, skip verification - we'll start default simulator.
@@ -259,8 +263,4 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
259
263
260
264
return _ . find ( availableDevices , { id : deviceId } ) ;
261
265
}
262
-
263
- private killSimulator ( ) : void {
264
- childProcess . execSync ( "pkill -9 -f Simulator" ) ;
265
- }
266
266
}
0 commit comments