Add support for passing --trace-startup on Android

iOS takes a different codepath and will need more work.

@chinmaygarde
This commit is contained in:
Eric Seidel 2015-12-03 12:23:52 -08:00
parent 31203a908b
commit 4eee2e4c1d
2 changed files with 8 additions and 0 deletions

View File

@ -27,6 +27,10 @@ class StartCommand extends FlutterCommand {
negatable: true,
defaultsTo: true,
help: 'Toggle Dart\'s checked mode.');
argParser.addFlag('trace-startup',
negatable: true,
defaultsTo: false,
help: 'Start tracing during startup.');
argParser.addOption('target',
defaultsTo: '',
abbr: 't',
@ -101,6 +105,7 @@ class StartCommand extends FlutterCommand {
if (device.startBundle(package, localBundlePath,
poke: poke,
checked: argResults['checked'],
traceStartup: argResults['trace-startup'],
route: argResults['route']))
startedSomething = true;
}

View File

@ -771,6 +771,7 @@ class AndroidDevice extends Device {
bool startBundle(AndroidApk apk, String bundlePath, {
bool poke,
bool checked,
bool traceStartup,
String route
}) {
logging.fine('$this startBundle');
@ -792,6 +793,8 @@ class AndroidDevice extends Device {
]);
if (checked)
cmd.addAll(['--ez', 'enable-checked-mode', 'true']);
if (traceStartup)
cmd.addAll(['--ez', 'trace-startup', 'true']);
if (route != null)
cmd.addAll(['--es', 'route', route]);
cmd.add(apk.launchActivity);