File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -439,16 +439,25 @@ export class PlatformService implements IPlatformService {
439
439
if ( this . $options . availableDevices ) {
440
440
return this . $emulatorPlatformService . listAvailableEmulators ( platform ) ;
441
441
}
442
+ this . $options . emulator = true ;
442
443
if ( this . $options . device ) {
443
444
let info = this . $emulatorPlatformService . getEmulatorInfo ( platform , this . $options . device ) . wait ( ) ;
444
445
if ( info ) {
445
446
if ( ! info . isRunning ) {
446
447
this . $emulatorPlatformService . startEmulator ( info ) . wait ( ) ;
447
448
}
448
449
this . $options . device = null ;
450
+ } else {
451
+ this . $devicesService . initialize ( { platform : platform , deviceId : this . $options . device } ) . wait ( ) ;
452
+ let found : Mobile . IDeviceInfo [ ] = [ ] ;
453
+ if ( this . $devicesService . hasDevices ) {
454
+ found = this . $devicesService . getDevices ( ) . filter ( ( device :Mobile . IDeviceInfo ) => device . identifier === this . $options . device ) ;
455
+ }
456
+ if ( found . length === 0 ) {
457
+ this . $errors . fail ( "Cannot find device with name: %s" , this . $options . device ) ;
458
+ }
449
459
}
450
460
}
451
- this . $options . emulator = true ;
452
461
this . deployPlatform ( platform ) . wait ( ) ;
453
462
return this . runPlatform ( platform ) ;
454
463
}
You can’t perform that action at this time.
0 commit comments