From a463f1ea3c62f0ece0be00d9d9ee19e12c5bd5f7 Mon Sep 17 00:00:00 2001 From: Vikas Aggarwal Date: Thu, 7 Mar 2024 21:23:49 -0500 Subject: [PATCH] fix: Change made to handle if mode in command argument includes build flavor as well, i.e. productionDebug. #2323 --- .../src/commands/runAndroid/tryInstallAppOnDevice.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cli-platform-android/src/commands/runAndroid/tryInstallAppOnDevice.ts b/packages/cli-platform-android/src/commands/runAndroid/tryInstallAppOnDevice.ts index b0a387ae4..17bda4643 100644 --- a/packages/cli-platform-android/src/commands/runAndroid/tryInstallAppOnDevice.ts +++ b/packages/cli-platform-android/src/commands/runAndroid/tryInstallAppOnDevice.ts @@ -16,10 +16,10 @@ function tryInstallAppOnDevice( // "app" is usually the default value for Android apps with only 1 app const {appName, sourceDir} = androidProject; - const defaultVariant = (args.mode || 'debug').toLowerCase(); + const defaultVariant = 'debug'; - // handle if selected task from interactive mode includes build flavour as well, eg. installProductionDebug should create ['production','debug'] array - const variantFromSelectedTask = selectedTask + // handle if selected task from interactive mode, or mode from arguments, includes build flavour as well, eg. installProductionDebug should create ['production','debug'] array + const variantFromSelectedTask = (selectedTask ?? args.mode) ?.replace('install', '') .split(/(?=[A-Z])/);