From 9fb520e3b223aeb31139b0c83ca4a1b6a1dfa488 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Wed, 23 Nov 2016 06:32:58 -0800 Subject: [PATCH] Add ability to specify main Activity in run-android Summary: Follow up to #8190 Tested with custom parameter as well as w/o (using default value). All worked well. Differential Revision: D4220565 Pulled By: mkonicek fbshipit-source-id: e8a98542d3ff96d60ff6045b328f5b464f78ee74 --- local-cli/runAndroid/runAndroid.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/local-cli/runAndroid/runAndroid.js b/local-cli/runAndroid/runAndroid.js index b3a7b48d6..5da78ceb8 100644 --- a/local-cli/runAndroid/runAndroid.js +++ b/local-cli/runAndroid/runAndroid.js @@ -164,7 +164,7 @@ function buildAndRun(args) { devices.forEach((device) => { const adbArgs = - ['-s', device, 'shell', 'am', 'start', '-n', packageName + '/.MainActivity']; + ['-s', device, 'shell', 'am', 'start', '-n', packageName + '/.' + args.mainActivity]; console.log(chalk.bold( `Starting the app on ${device} (${adbPath} ${adbArgs.join(' ')})...` @@ -251,5 +251,9 @@ module.exports = { default: 'Debug' }, { command: '--variant [string]', + }, { + command: '--main-activity [string]', + description: 'Name of the activity to start', + default: 'MainActivity' }], };