decouple `flutter drive` from `flutter start`
flutter start's method of finding devices to run the app on is not suitable for flutter drive.
This commit also refactors several tool services to allow mocking in unit tests.
diff --git a/packages/flutter_tools/lib/src/device.dart b/packages/flutter_tools/lib/src/device.dart
index 8ad0635..520ddd2 100644
--- a/packages/flutter_tools/lib/src/device.dart
+++ b/packages/flutter_tools/lib/src/device.dart
@@ -130,6 +130,9 @@
bool get supportsStartPaused => true;
+ /// Whether it is an emulated device running on localhost.
+ bool get isLocalEmulator;
+
/// Install an app package on the current device
bool installApp(ApplicationPackage app);
@@ -259,7 +262,7 @@
break;
case TargetPlatform.iOSSimulator:
assert(iOSSimulator == null);
- iOSSimulator = _deviceForConfig(config, IOSSimulator.getAttachedDevices());
+ iOSSimulator = _deviceForConfig(config, IOSSimulatorUtils.instance.getAttachedDevices());
break;
case TargetPlatform.mac:
case TargetPlatform.linux: