Commit f9876cba authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Wait for stopApp to complete before proceeding with the app install/run flow (#5412)

parent 6e62df42
...@@ -237,14 +237,10 @@ Future<int> startApp( ...@@ -237,14 +237,10 @@ Future<int> startApp(
if (stop) { if (stop) {
if (package != null) { if (package != null) {
printTrace("Stopping app '${package.name}' on ${device.name}."); printTrace("Stopping app '${package.name}' on ${device.name}.");
// We don't wait for the stop command to complete. await device.stopApp(package);
device.stopApp(package);
} }
} }
// Allow any stop commands from above to start work.
await new Future<Duration>.delayed(Duration.ZERO);
// TODO(devoncarew): This fails for ios devices - we haven't built yet. // TODO(devoncarew): This fails for ios devices - we haven't built yet.
if (install && device is AndroidDevice) { if (install && device is AndroidDevice) {
printStatus('Installing $package to $device...'); printStatus('Installing $package to $device...');
......
...@@ -137,13 +137,9 @@ class RunAndStayResident extends ResidentRunner { ...@@ -137,13 +137,9 @@ class RunAndStayResident extends ResidentRunner {
// TODO(devoncarew): Move this into the device.startApp() impls. // TODO(devoncarew): Move this into the device.startApp() impls.
if (_package != null) { if (_package != null) {
printTrace("Stopping app '${_package.name}' on ${device.name}."); printTrace("Stopping app '${_package.name}' on ${device.name}.");
// We don't wait for the stop command to complete. await device.stopApp(_package);
device.stopApp(_package);
} }
// Allow any stop commands from above to start work.
await new Future<Duration>.delayed(Duration.ZERO);
// TODO(devoncarew): This fails for ios devices - we haven't built yet. // TODO(devoncarew): This fails for ios devices - we haven't built yet.
if (device is AndroidDevice) { if (device is AndroidDevice) {
printTrace('Running install command.'); printTrace('Running install command.');
......
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