Permalink
Browse files

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
  • Loading branch information...
1 parent 5db7484 commit 9fb520e3b223aeb31139b0c83ca4a1b6a1dfa488 @grabbou grabbou committed with Facebook Github Bot Nov 23, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 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'
}],
};

0 comments on commit 9fb520e

Please sign in to comment.