// DEVELOPER TOOL (Cotton Dev only): a simulator's airplane mode. A simulator has none, and switching the Mac's own// network off would cut every other lane on it, so a walk flips the core's network cut (`developer.cutNetwork`)// with a system notification, as Face ID is matched://// xcrun simctl spawn <udid> notifyutil -p cotton.dev.network.off every dial fails as with no network// xcrun simctl spawn <udid> notifyutil -p cotton.dev.network.on back online//// Then the loop is told to try now, so the change shows without waiting out its backoff.#if COTTON_DEV && os(iOS)importCottonKitimportFoundationimport notify@MainActorenumDevNetworkCut {privatestaticvar listening = falsestaticfunc listen(_ core: any CottonCalling) {guard !listening else { return } listening = true register("cotton.dev.network.off") { cut(true, core) } register("cotton.dev.network.on") { cut(false, core) } }privatestaticfunc register(_ name: String, _ run: @escaping @MainActor () -> Void) {var token: Int32 = 0 notify_register_dispatch(name, &token, .main) { _ inMainActor.assumeIsolated { run() } } }privatestructAsk: Encodable, Sendable { let on: Bool }privatestaticfunc cut(_ on: Bool, _ core: any CottonCalling) {Task { _ = try? await core.callJSON("developer.cutNetwork", Ask(on: on))Log.write("dev: the network is \(on ? "cut" : "back")") _ = try? await core.callJSON(CottonMethod.syncNow, EmptyRequest()) } }}#endif