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

#4672
This commit is contained in:
Todd Volkert 2016-06-22 15:43:57 -07:00 committed by GitHub
parent bb2e7b5250
commit e91f3eef46
4 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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');

View File

@ -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;
}

View File

@ -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;
}