11import { cache } from "../common/decorators" ;
22import { ValidatePlatformCommandBase } from "./command-base" ;
3+ import { hasValidAndroidSigning } from "../common/helpers" ;
4+ import { ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE } from "../constants" ;
35
46export class DebugPlatformCommand extends ValidatePlatformCommandBase implements ICommand {
57 public allowedParameters : ICommandParameter [ ] = [ ] ;
@@ -155,7 +157,8 @@ export class DebugAndroidCommand implements ICommand {
155157 private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
156158 private $injector : IInjector ,
157159 private $projectData : IProjectData ,
158- private $markingModeService : IMarkingModeService ) {
160+ private $markingModeService : IMarkingModeService ,
161+ private $options : IOptions ) {
159162 this . $projectData . initializeProjectData ( ) ;
160163 }
161164
@@ -164,8 +167,14 @@ export class DebugAndroidCommand implements ICommand {
164167 return this . debugPlatformCommand . execute ( args ) ;
165168 }
166169 public async canExecute ( args : string [ ] ) : Promise < boolean > {
167- const result = await this . debugPlatformCommand . canExecute ( args ) ;
168- return result ;
170+ const canExecuteBase = await this . debugPlatformCommand . canExecute ( args ) ;
171+ if ( canExecuteBase ) {
172+ if ( this . $options . aab && ! hasValidAndroidSigning ( this . $options ) ) {
173+ this . $errors . failWithHelp ( ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE ) ;
174+ }
175+ }
176+
177+ return canExecuteBase ;
169178 }
170179
171180 public platform = this . $devicePlatformsConstants . Android ;
0 commit comments