@@ -16,6 +16,10 @@ export class DebugPlatformCommand implements ICommand {
16
16
canExecute ( args : string [ ] ) : IFuture < boolean > {
17
17
return ( ( ) : boolean => {
18
18
this . $devicesService . initialize ( { platform : this . debugService . platform , deviceId : this . $options . device } ) . wait ( ) ;
19
+ if ( this . $options . emulator ) {
20
+ return true ;
21
+ }
22
+
19
23
if ( this . $devicesService . deviceCount === 0 ) {
20
24
this . $errors . failWithoutHelp ( "No devices detected. Connect a device and try again." ) ;
21
25
} else if ( this . $devicesService . deviceCount > 1 ) {
@@ -34,16 +38,6 @@ export class DebugIOSCommand extends DebugPlatformCommand {
34
38
$options : IOptions ) {
35
39
super ( $iOSDebugService , $devicesService , $errors , $options ) ;
36
40
}
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
- }
47
41
}
48
42
$injector . registerCommand ( "debug|ios" , DebugIOSCommand ) ;
49
43
@@ -54,9 +48,5 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
54
48
$options : IOptions ) {
55
49
super ( $androidDebugService , $devicesService , $errors , $options ) ;
56
50
}
57
-
58
- canExecute ( args : string [ ] ) : IFuture < boolean > {
59
- return super . canExecute ( args ) ;
60
- }
61
51
}
62
52
$injector . registerCommand ( "debug|android" , DebugAndroidCommand ) ;
0 commit comments