Skip to content

Commit ebdab76

Browse files
Skip clearing logs (GitHub says not permitted). Send the deep link.
1 parent 86ccde0 commit ebdab76

File tree

1 file changed

+36
-34
lines changed

1 file changed

+36
-34
lines changed

packages/flutter_test_runners/lib/src/deep_links/deep_links_ios.dart

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,42 @@ void testDeepLinkIosAppLaunch(
4949
expect(await Xcrun.isAppRunning(appBundleId), isFalse);
5050
_log.info("We've verified the app isn't running");
5151

52-
// Clear previous logcat messages so we don't try to connect to a previous
53-
// Dart VM service listing.
54-
_log.info("Clearing old logs");
55-
await Xcrun.clearLogs();
56-
_log.info("We've cleared old logs");
57-
58-
// // Listen to iOS logs to find the Dart VM service for the running app.
59-
// _log.info("Registering for simulator logs");
60-
// String? dartVmService;
61-
// await Xcrun.listenToXcrunForFlutterLogs(
62-
// appBundleId,
63-
// onLog: (log) {
64-
// // _log.info(log);
65-
// if (log.contains("Dart VM service")) {
66-
// _log.info("Found Dart VM log:\n$log");
67-
//
68-
// final regex = RegExp(r'.*Dart VM service.*(http[s]?://[^\s]+)');
69-
// final httpUrl = Uri.parse(regex.firstMatch(log)!.group(1)!);
70-
//
71-
// dartVmService =
72-
// Uri(scheme: "ws", host: httpUrl.host, port: httpUrl.port, path: "${httpUrl.path}ws").toString();
73-
// }
74-
// },
75-
// onError: (error) {
76-
// _log.shout("iOS ERROR:");
77-
// _log.shout(error);
78-
// },
79-
// );
80-
// _log.info("We're now listening to logs and errors from iOS");
81-
//
82-
// // Send the deep link.
83-
// _log.info("Sending the deep link: $deepLink");
84-
// await Xcrun.launchAppWithUniversalLink(universalLink: deepLink);
85-
//
52+
// FIXME: At the moment GitHub CI is saying this operation isn't permitted.
53+
// // Clear previous logcat messages so we don't try to connect to a previous
54+
// // Dart VM service listing.
55+
// _log.info("Clearing old logs");
56+
// await Xcrun.clearLogs();
57+
// _log.info("We've cleared old logs");
58+
print("NOT clearing logs because GitHub CI says not permitted");
59+
60+
// Listen to iOS logs to find the Dart VM service for the running app.
61+
_log.info("Registering for simulator logs");
62+
String? dartVmService;
63+
await Xcrun.listenToXcrunForFlutterLogs(
64+
appBundleId,
65+
onLog: (log) {
66+
// _log.info(log);
67+
if (log.contains("Dart VM service")) {
68+
_log.info("Found Dart VM log:\n$log");
69+
70+
final regex = RegExp(r'.*Dart VM service.*(http[s]?://[^\s]+)');
71+
final httpUrl = Uri.parse(regex.firstMatch(log)!.group(1)!);
72+
73+
dartVmService =
74+
Uri(scheme: "ws", host: httpUrl.host, port: httpUrl.port, path: "${httpUrl.path}ws").toString();
75+
}
76+
},
77+
onError: (error) {
78+
_log.shout("iOS ERROR:");
79+
_log.shout(error);
80+
},
81+
);
82+
_log.info("We're now listening to logs and errors from iOS");
83+
84+
// Send the deep link.
85+
_log.info("Sending the deep link: $deepLink");
86+
await Xcrun.launchAppWithUniversalLink(universalLink: deepLink);
87+
8688
// // Wait until the deep link launches the app.
8789
// _log.info("Waiting for app to launch: $appBundleId");
8890
// final isAppRunning = await Xcrun.waitForAppToLaunch(appBundleId);

0 commit comments

Comments
 (0)