Skip to content

Commit 9fb520e

Browse files
grabbouFacebook Github Bot
authored andcommitted
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
1 parent 5db7484 commit 9fb520e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

local-cli/runAndroid/runAndroid.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function buildAndRun(args) {
164164
devices.forEach((device) => {
165165

166166
const adbArgs =
167-
['-s', device, 'shell', 'am', 'start', '-n', packageName + '/.MainActivity'];
167+
['-s', device, 'shell', 'am', 'start', '-n', packageName + '/.' + args.mainActivity];
168168

169169
console.log(chalk.bold(
170170
`Starting the app on ${device} (${adbPath} ${adbArgs.join(' ')})...`
@@ -251,5 +251,9 @@ module.exports = {
251251
default: 'Debug'
252252
}, {
253253
command: '--variant [string]',
254+
}, {
255+
command: '--main-activity [string]',
256+
description: 'Name of the activity to start',
257+
default: 'MainActivity'
254258
}],
255259
};

0 commit comments

Comments
 (0)