Flutter `emulator launch` crash running in dart-2-mode (#19454)
* Only printError on our simple messages
Any other type is a real error that should be a normal crash (to get a proper error log).
See #19453.
* Add toList() to convert Iterable<String> -> List<String>
This code previously throw in Dart-2 mode.
Fixes #19453.
* Move getSimulatorPath into Xcode
* Add a test that we tried to launch the simulator
* Remove unused import
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index d5a2c6b..85d4d87 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -167,6 +167,18 @@
Future<RunResult> clang(List<String> args) {
return runCheckedAsync(<String>['xcrun', 'clang']..addAll(args));
}
+
+ String getSimulatorPath() {
+ if (xcodeSelectPath == null)
+ return null;
+ final List<String> searchPaths = <String>[
+ fs.path.join(xcodeSelectPath, 'Applications', 'Simulator.app'),
+ ];
+ return searchPaths.where((String p) => p != null).firstWhere(
+ (String p) => fs.directory(p).existsSync(),
+ orElse: () => null,
+ );
+ }
}
Future<XcodeBuildResult> buildXcodeProject({