clearSimLocation function

Future<SimLocationResult> clearSimLocation(
  1. SimLocationClearInput input
)

Stops location simulation on the iOS simulator.

Never throws; all error conditions are represented as sealed result cases.

Implementation

Future<SimLocationResult> clearSimLocation(SimLocationClearInput input) async {
  final resolved = await resolveSimulatorDevice(deviceOverride: input.deviceOverride);
  if (resolved.error != null) {
    return SimLocationFailed(resolved.error!);
  }
  final device = resolved.udid!;
  final error = await runSimctl(['location', device, 'clear']);
  if (error != null) {
    return SimLocationFailed(error);
  }
  return const SimLocationCleared();
}