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 @@ -439,16 +439,25 @@ export class PlatformService implements IPlatformService {
439439 if ( this . $options . availableDevices ) {
440440 return this . $emulatorPlatformService . listAvailableEmulators ( platform ) ;
441441 }
442+ this . $options . emulator = true ;
442443 if ( this . $options . device ) {
443444 let info = this . $emulatorPlatformService . getEmulatorInfo ( platform , this . $options . device ) . wait ( ) ;
444445 if ( info ) {
445446 if ( ! info . isRunning ) {
446447 this . $emulatorPlatformService . startEmulator ( info ) . wait ( ) ;
447448 }
448449 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+ }
449459 }
450460 }
451- this . $options . emulator = true ;
452461 this . deployPlatform ( platform ) . wait ( ) ;
453462 return this . runPlatform ( platform ) ;
454463 }
You can’t perform that action at this time.
0 commit comments