@@ -18,17 +18,17 @@ export class XCode6Simulator extends iPhoneSimulatorBaseLib.IPhoneInteropSimulat
18
18
19
19
constructor ( ) {
20
20
super ( this ) ;
21
-
21
+
22
22
this . cachedDevices = null ;
23
23
}
24
24
25
25
public setSimulatedDevice ( config : any ) : void {
26
- let device = this . getDeviceByName ( ) . device ;
26
+ let device = this . getDeviceByName ( ) . rawDevice ;
27
27
config ( "setDevice" , device ) ;
28
28
}
29
29
30
30
public getSimulatedDevice ( ) : any {
31
- return this . getDeviceByName ( ) . device ;
31
+ return this . getDeviceByName ( ) . rawDevice ;
32
32
}
33
33
34
34
public getDevices ( ) : IFuture < IDevice [ ] > {
@@ -57,7 +57,7 @@ export class XCode6Simulator extends iPhoneSimulatorBaseLib.IPhoneInteropSimulat
57
57
let runtimeVersion = device ( "runtime" ) ( "versionString" ) . toString ( ) ;
58
58
59
59
this . cachedDevices . push ( {
60
- name : "" ,
60
+ name : deviceIdentifierWithoutPrefix ,
61
61
id : deviceIdentifierWithoutPrefix ,
62
62
fullId : this . buildFullDeviceIdentifier ( deviceIdentifier ) ,
63
63
runtimeVersion : runtimeVersion ,
@@ -109,8 +109,9 @@ export class XCode6Simulator extends iPhoneSimulatorBaseLib.IPhoneInteropSimulat
109
109
return options . device || XCode6Simulator . DEFAULT_DEVICE_IDENTIFIER ;
110
110
}
111
111
112
- private getDeviceByName ( ) : any {
113
- let device = _ . find ( this . devices , ( device ) => device . name === this . deviceName ) ;
112
+ private getDeviceByName ( ) : IDevice {
113
+ let devices = this . getDevices ( ) . wait ( ) ;
114
+ let device = _ . find ( devices , ( device ) => device . name === this . deviceName ) ;
114
115
if ( ! device ) {
115
116
errors . fail ( "Unable to find device with name " , this . deviceName ) ;
116
117
}
0 commit comments