Skip to content

Commit

Permalink
[cli] print the actual commands being run by run-android
Browse files Browse the repository at this point in the history
  • Loading branch information
foghina committed Aug 26, 2015
1 parent 358f81a commit 4ddbb5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions local-cli/run-android.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ module.exports = function() {
return;
}
// start packager first so it warms up
console.log('Starting JS server...');
console.log(chalk.white('Starting JS server...'));
runPackager();

process.chdir('android');
try {
console.log('Building with gradle...');
var cmd = process.platform.startsWith('win') ? 'gradlew.bat' : './gradlew';
var args = ['installDebug'].concat(process.argv.slice(3));
console.log(chalk.white('Building with gradle [' + cmd + ' ' + args.join(' ') + ']...'));
child_process.execFileSync(cmd, args);
} catch (e) {
console.log(chalk.red('Gradle invocation failed!'));
Expand All @@ -35,9 +35,9 @@ module.exports = function() {
return;
}
try {
console.log('Starting app with adb...');
var packageName = fs.readFileSync('app/src/main/AndroidManifest.xml', 'utf8').match(/package="(.+?)"/)[1];
var args = ['shell', 'am', 'start', '-n', packageName + '/.MainActivity'];
console.log(chalk.white('Starting app with adb [adb ' + args.join(' ') + ']...'));
child_process.spawnSync('adb', args);
} catch (e) {
console.log(chalk.red('adb invocation failed! Do you have adb in your PATH?'));
Expand Down

0 comments on commit 4ddbb5e

Please sign in to comment.