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 @@ -458,16 +458,25 @@ export class PlatformService implements IPlatformService {
458
458
if ( this . $options . availableDevices ) {
459
459
return this . $emulatorPlatformService . listAvailableEmulators ( platform ) ;
460
460
}
461
+ this . $options . emulator = true ;
461
462
if ( this . $options . device ) {
462
463
let info = this . $emulatorPlatformService . getEmulatorInfo ( platform , this . $options . device ) . wait ( ) ;
463
464
if ( info ) {
464
465
if ( ! info . isRunning ) {
465
466
this . $emulatorPlatformService . startEmulator ( info ) . wait ( ) ;
466
467
}
467
468
this . $options . device = null ;
469
+ } else {
470
+ this . $devicesService . initialize ( { platform : platform , deviceId : this . $options . device } ) . wait ( ) ;
471
+ let found : Mobile . IDeviceInfo [ ] = [ ] ;
472
+ if ( this . $devicesService . hasDevices ) {
473
+ found = this . $devicesService . getDevices ( ) . filter ( ( device :Mobile . IDeviceInfo ) => device . identifier === this . $options . device ) ;
474
+ }
475
+ if ( found . length === 0 ) {
476
+ this . $errors . fail ( "Cannot find device with name: %s" , this . $options . device ) ;
477
+ }
468
478
}
469
479
}
470
- this . $options . emulator = true ;
471
480
this . deployPlatform ( platform ) . wait ( ) ;
472
481
return this . runPlatform ( platform ) ;
473
482
}
You can’t perform that action at this time.
0 commit comments