iosCrashes function
Crash reports the simulator wrote to the host for bundleId since since, newest first.
Implementation
List<NativeCrash> iosCrashes({required String bundleId, required DateTime since, String? dir}) {
final d = Directory(dir ?? '${Platform.environment['HOME'] ?? '.'}/Library/Logs/DiagnosticReports');
if (!d.existsSync()) return const [];
final out = <NativeCrash>[];
for (final f in d.listSync().whereType<File>()) {
if (!f.path.endsWith('.ips') || f.lastModifiedSync().isBefore(since)) continue;
final crash = parseIpsCrash(f.readAsStringSync(), bundleId: bundleId, path: f.path);
if (crash != null && !crash.time.isBefore(since)) out.add(crash);
}
out.sort((a, b) => b.time.compareTo(a.time));
return out;
}