From f9876cba4c51983430d049546abaccb456d97c54 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 15 Aug 2016 15:24:00 -0700 Subject: [PATCH] Wait for stopApp to complete before proceeding with the app install/run flow (#5412) --- packages/flutter_tools/lib/src/commands/run.dart | 6 +----- packages/flutter_tools/lib/src/run.dart | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart index 876e144746..c94c817de1 100644 --- a/packages/flutter_tools/lib/src/commands/run.dart +++ b/packages/flutter_tools/lib/src/commands/run.dart @@ -237,14 +237,10 @@ Future startApp( if (stop) { if (package != null) { printTrace("Stopping app '${package.name}' on ${device.name}."); - // We don't wait for the stop command to complete. - device.stopApp(package); + await device.stopApp(package); } } - // Allow any stop commands from above to start work. - await new Future.delayed(Duration.ZERO); - // TODO(devoncarew): This fails for ios devices - we haven't built yet. if (install && device is AndroidDevice) { printStatus('Installing $package to $device...'); diff --git a/packages/flutter_tools/lib/src/run.dart b/packages/flutter_tools/lib/src/run.dart index 7145338533..26a73f1bac 100644 --- a/packages/flutter_tools/lib/src/run.dart +++ b/packages/flutter_tools/lib/src/run.dart @@ -137,13 +137,9 @@ class RunAndStayResident extends ResidentRunner { // TODO(devoncarew): Move this into the device.startApp() impls. if (_package != null) { printTrace("Stopping app '${_package.name}' on ${device.name}."); - // We don't wait for the stop command to complete. - device.stopApp(_package); + await device.stopApp(_package); } - // Allow any stop commands from above to start work. - await new Future.delayed(Duration.ZERO); - // TODO(devoncarew): This fails for ios devices - we haven't built yet. if (device is AndroidDevice) { printTrace('Running install command.');