Beginning implementation of IOSDevice. Implements list and install.
Also update tests to be compatible with the presence of iOS and add tests for list and install.
diff --git a/packages/flutter_tools/lib/src/install.dart b/packages/flutter_tools/lib/src/install.dart
index f7ee8fc..d29ded1 100644
--- a/packages/flutter_tools/lib/src/install.dart
+++ b/packages/flutter_tools/lib/src/install.dart
@@ -16,15 +16,12 @@
final description = 'Install your Flutter app on attached devices.';
AndroidDevice android = null;
+ IOSDevice ios;
- InstallCommand([this.android]);
+ InstallCommand({this.android, this.ios});
@override
Future<int> run() async {
- if (android == null) {
- android = new AndroidDevice();
- }
-
if (install()) {
return 0;
} else {
@@ -33,15 +30,28 @@
}
bool install() {
+ if (android == null) {
+ android = new AndroidDevice();
+ }
+ if (ios == null) {
+ ios = new IOSDevice();
+ }
+
bool installedSomewhere = false;
Map<BuildPlatform, ApplicationPackage> packages =
ApplicationPackageFactory.getAvailableApplicationPackages();
ApplicationPackage androidApp = packages[BuildPlatform.android];
+ ApplicationPackage iosApp = packages[BuildPlatform.iOS];
+
if (androidApp != null && android.isConnected()) {
installedSomewhere = android.installApp(androidApp) || installedSomewhere;
}
+ if (iosApp != null && ios.isConnected()) {
+ installedSomewhere = ios.installApp(iosApp) || installedSomewhere;
+ }
+
return installedSomewhere;
}
}