@@ -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}
0 commit comments