nativeCrashes method

Future<List<NativeCrash>> nativeCrashes()

Native crashes of this app since attach: the simulator's crash reports on iOS, the crash log buffer on Android.

Implementation

Future<List<NativeCrash>> nativeCrashes() async {
  final since = attachedAt.subtract(const Duration(seconds: 5));
  final dev = device;
  switch (dev) {
    case IosSimulator():
      final id = bundleId;
      return id == null ? const [] : iosCrashes(bundleId: id, since: since);
    case IosDevice():
      final id = bundleId;
      return id == null ? const [] : phoneCrashes(udid: dev.udid, bundleId: id, since: since);
    case AndroidDevice():
      final reader = nativeReader;
      final pkg = (reader is AndroidNativeReader ? reader.appPackage : null) ?? package;
      return pkg == null
          ? const []
          : androidCrashes(serial: dev.serial, adbPath: dev.adbPath, package: pkg, since: since);
  }
}