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
This commit is contained in:
Mike Grabowski 2016-11-23 06:32:58 -08:00 коммит произвёл Facebook Github Bot
Родитель 5db7484e8d
Коммит 9fb520e3b2
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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'
}],
};