File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 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 {
458458 if ( this . $options . availableDevices ) {
459459 return this . $emulatorPlatformService . listAvailableEmulators ( platform ) ;
460460 }
461+ this . $options . emulator = true ;
461462 if ( this . $options . device ) {
462463 let info = this . $emulatorPlatformService . getEmulatorInfo ( platform , this . $options . device ) . wait ( ) ;
463464 if ( info ) {
464465 if ( ! info . isRunning ) {
465466 this . $emulatorPlatformService . startEmulator ( info ) . wait ( ) ;
466467 }
467468 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+ }
468478 }
469479 }
470- this . $options . emulator = true ;
471480 this . deployPlatform ( platform ) . wait ( ) ;
472481 return this . runPlatform ( platform ) ;
473482 }
You can’t perform that action at this time.
0 commit comments