Commit e91f3eef authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Don't uninstall before installing in `flutter run` (#4699)

#4672
parent bb2e7b52
......@@ -31,8 +31,8 @@ class AnalyzeCommand extends FlutterCommand {
argParser.addFlag('preamble', help: 'Display the number of files that will be analyzed.', defaultsTo: true);
argParser.addFlag('congratulate', help: 'Show output even when there are no errors, warnings, hints, or lints.', defaultsTo: true);
argParser.addFlag('watch', help: 'Run analysis continuously, watching the filesystem for changes.', negatable: false);
argParser.addOption('write', help: 'Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.');
argParser.addOption('dart-sdk', help: 'The path to the Dart SDK.', hide: true);
argParser.addOption('write', valueHelp: 'file', help: 'Also output the results to a file. This is useful with --watch if you want a file to always contain the latest results.');
argParser.addOption('dart-sdk', valueHelp: 'path-to-sdk', help: 'The path to the Dart SDK.', hide: true);
// Hidden option to enable a benchmarking mode.
argParser.addFlag('benchmark', negatable: false, hide: true);
......
......@@ -33,11 +33,11 @@ class InstallCommand extends FlutterCommand {
}
}
bool installApp(Device device, ApplicationPackage package) {
bool installApp(Device device, ApplicationPackage package, { bool uninstall: true }) {
if (package == null)
return false;
if (device.isAppInstalled(package)) {
if (uninstall && device.isAppInstalled(package)) {
printStatus('Uninstalling old version...');
if (!device.uninstallApp(package))
printError('Warning: uninstalling old version failed');
......
......@@ -213,7 +213,7 @@ Future<int> startApp(
if (install && device is AndroidDevice) {
printStatus('Installing $package to $device...');
if (!(installApp(device, package)))
if (!(installApp(device, package, uninstall: false)))
return 1;
}
......
......@@ -164,7 +164,7 @@ class RunAndStayResident {
// TODO(devoncarew): This fails for ios devices - we haven't built yet.
if (device is AndroidDevice) {
printTrace('Running install command.');
if (!(installApp(device, _package)))
if (!(installApp(device, _package, uninstall: false)))
return 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment