Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/flutter_tools/lib/src/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import 'package:stack_trace/stack_trace.dart';
import 'application_package.dart';
import 'base/logger.dart';
import 'base/utils.dart';
import 'build_info.dart';
import 'commands/build_apk.dart';
import 'commands/install.dart';
import 'commands/trace.dart';
import 'device.dart';
import 'globals.dart';
import 'vmservice.dart';
import 'resident_runner.dart';
import 'vmservice.dart';

class RunAndStayResident extends ResidentRunner {
RunAndStayResident(
Expand Down Expand Up @@ -199,8 +198,6 @@ class RunAndStayResident extends ResidentRunner {
}

printTrace('Application running.');
if (debuggingOptions.buildMode == BuildMode.release)
return 0;

if (vmService != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this line and the next to preserve the flutter run --release behavior
by modifying the if expression?

if (isNotDaemonMode && debuggingOptions.buildMode == BuildMode.release)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to land this as is; I'd like to avoid having checks and different behavior based on modes.

await vmService.vm.refreshViews();
Expand Down Expand Up @@ -281,6 +278,13 @@ class RunAndStayResident extends ResidentRunner {
printStatus('For a more detailed help message, press "h" or F1. To quit, press "q", F10, or Ctrl-C.');
}
}

@override
Future<Null> preStop() async {
// If we're running in release mode, stop the app using the device logic.
if (vmService == null)
await device.stopApp(_package);
}
}

void writeRunBenchmarkFile(Stopwatch startTime, [Stopwatch restartTime]) {
Expand Down