@@ -16,6 +16,10 @@ export class DebugPlatformCommand implements ICommand {
1616 canExecute ( args : string [ ] ) : IFuture < boolean > {
1717 return ( ( ) : boolean => {
1818 this . $devicesService . initialize ( { platform : this . debugService . platform , deviceId : this . $options . device } ) . wait ( ) ;
19+ if ( this . $options . emulator ) {
20+ return true ;
21+ }
22+
1923 if ( this . $devicesService . deviceCount === 0 ) {
2024 this . $errors . failWithoutHelp ( "No devices detected. Connect a device and try again." ) ;
2125 } else if ( this . $devicesService . deviceCount > 1 ) {
@@ -34,16 +38,6 @@ export class DebugIOSCommand extends DebugPlatformCommand {
3438 $options : IOptions ) {
3539 super ( $iOSDebugService , $devicesService , $errors , $options ) ;
3640 }
37-
38- canExecute ( args : string [ ] ) : IFuture < boolean > {
39- return ( ( ) : boolean => {
40- if ( this . $options . emulator ) {
41- return true ;
42- }
43-
44- return super . canExecute ( args ) . wait ( ) ;
45- } ) . future < boolean > ( ) ( ) ;
46- }
4741}
4842$injector . registerCommand ( "debug|ios" , DebugIOSCommand ) ;
4943
@@ -54,9 +48,5 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
5448 $options : IOptions ) {
5549 super ( $androidDebugService , $devicesService , $errors , $options ) ;
5650 }
57-
58- canExecute ( args : string [ ] ) : IFuture < boolean > {
59- return super . canExecute ( args ) ;
60- }
6151}
6252$injector . registerCommand ( "debug|android" , DebugAndroidCommand ) ;
0 commit comments