77 private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
88 private $config : IConfiguration ,
99 private $usbLiveSyncService : ILiveSyncService ,
10- private $platformService : IPlatformService ,
11- protected $options : IOptions ) { }
10+ protected $platformService : IPlatformService ,
11+ protected $options : IOptions ,
12+ protected $platformsData : IPlatformsData ) { }
1213
1314 execute ( args : string [ ] ) : IFuture < void > {
1415 if ( this . $options . start ) {
@@ -67,8 +68,16 @@ export class DebugIOSCommand extends DebugPlatformCommand {
6768 $config : IConfiguration ,
6869 $usbLiveSyncService : ILiveSyncService ,
6970 $platformService : IPlatformService ,
70- $options : IOptions ) {
71- super ( $iOSDebugService , $devicesService , $injector , $logger , $childProcess , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options ) ;
71+ $options : IOptions ,
72+ $platformsData : IPlatformsData ) {
73+
74+ super ( $iOSDebugService , $devicesService , $injector , $logger , $childProcess , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
75+ }
76+
77+ canExecute ( args : string [ ] ) : IFuture < boolean > {
78+ return ( ( ) => {
79+ return super . canExecute ( args ) . wait ( ) && this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . iOS ) . wait ( ) ;
80+ } ) . future < boolean > ( ) ( ) ;
7281 }
7382}
7483$injector . registerCommand ( "debug|ios" , DebugIOSCommand ) ;
@@ -83,8 +92,16 @@ export class DebugAndroidCommand extends DebugPlatformCommand {
8392 $config : IConfiguration ,
8493 $usbLiveSyncService : ILiveSyncService ,
8594 $platformService : IPlatformService ,
86- $options : IOptions ) {
87- super ( $androidDebugService , $devicesService , $injector , $logger , $childProcess , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options ) ;
95+ $options : IOptions ,
96+ $platformsData : IPlatformsData ) {
97+
98+ super ( $androidDebugService , $devicesService , $injector , $logger , $childProcess , $devicePlatformsConstants , $config , $usbLiveSyncService , $platformService , $options , $platformsData ) ;
99+ }
100+
101+ canExecute ( args : string [ ] ) : IFuture < boolean > {
102+ return ( ( ) => {
103+ return super . canExecute ( args ) . wait ( ) && this . $platformService . validateOptions ( this . $platformsData . availablePlatforms . Android ) . wait ( ) ;
104+ } ) . future < boolean > ( ) ( ) ;
88105 }
89106}
90107$injector . registerCommand ( "debug|android" , DebugAndroidCommand ) ;
0 commit comments