@@ -40,11 +40,11 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
40
40
} ) ;
41
41
}
42
42
43
- public async run ( applicationPath : string , applicationIdentifier : string ) : void {
43
+ public run ( applicationPath : string , applicationIdentifier : string ) : void {
44
44
let device = this . getDeviceToRun ( ) ;
45
45
let currentBootedDevice = _ . find ( this . getDevices ( ) , device => this . isDeviceBooted ( device ) ) ;
46
46
if ( currentBootedDevice && ( currentBootedDevice . name . toLowerCase ( ) !== device . name . toLowerCase ( ) || currentBootedDevice . runtimeVersion !== device . runtimeVersion ) ) {
47
- await this . killSimulator ( ) ;
47
+ this . killSimulator ( ) ;
48
48
}
49
49
50
50
this . startSimulator ( device ) ;
@@ -145,23 +145,23 @@ export class XCodeSimctlSimulator extends IPhoneSimulatorNameGetter implements I
145
145
return _ . find ( devices , device => this . isDeviceBooted ( device ) ) ;
146
146
}
147
147
148
- public async startSimulator ( device ?: IDevice ) : void {
148
+ public startSimulator ( device ?: IDevice ) : void {
149
149
device = device || this . getDeviceToRun ( ) ;
150
150
if ( ! this . isDeviceBooted ( device ) ) {
151
151
let bootedDevice = this . getBootedDevice ( ) ;
152
152
if ( bootedDevice && bootedDevice . id !== device . id ) {
153
- await this . killSimulator ( ) ;
153
+ this . killSimulator ( ) ;
154
154
}
155
155
156
156
common . startSimulator ( device . id ) ;
157
157
// startSimulaltor doesn't always finish immediately, and the subsequent
158
158
// install fails since the simulator is not running.
159
159
// Give it some time to start before we attempt installing.
160
- utils . sleep ( 1000 ) ;
160
+ utils . sleep ( 1000 ) ;
161
161
}
162
162
}
163
-
164
- private async killSimulator ( ) : Promise < any > {
165
- return childProcess . spawn ( "pkill" , [ "-9" , "-f" , " Simulator"] ) ;
163
+
164
+ private killSimulator ( ) : Promise < any > {
165
+ childProcess . execSync ( "pkill -9 -f Simulator" ) ;
166
166
}
167
167
}
0 commit comments