From 35dee10f82711101a7d30d03f0ec781ac23221e9 Mon Sep 17 00:00:00 2001 From: Peter A Date: Sat, 22 Aug 2026 17:07:04 +0200 Subject: macOS: Avoid deviceinterfaced races during DFU reconnect During Port DFU-to-DFU re-enumeration, macOS deviceinterfaced daemon can acquire the USB interface first, making idevicerestore time out waiting for DFU reconnection. Add experimental flag: --exclusive-usb that keeps deviceinterfaced from claiming the USB device for the duration of the restore, by booting it out or repeatedly terminating it when bootout is denied (SIP on), then reloading and starting it again on exit. idevicerestore itself does not need to run as root for this. Only the launchctl subcommands that manage the system-domain deviceinterfaced daemon (bootout, bootstrap, kickstart, kill) are elevated individually via sudo, which may prompt for a password on the controlling terminal. Read-only queries (print) are run unprivileged. Document how to allow these specific commands via a scoped sudoers(5) NOPASSWD rule for unattended use. Co-authored-by: Nikias Bassen --- src/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 2b7084e..c61dfd7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -47,6 +47,9 @@ idevicerestore_SOURCES = \ ace3.c ace3.h \ download.c download.h \ locking.c locking.h +if DARWIN +idevicerestore_SOURCES += deviceinterfaced.c deviceinterfaced.h +endif if HAVE_LIMERA1N idevicerestore_SOURCES += limera1n_payload.h limera1n.c limera1n.h endif -- cgit v1.1-32-gdbae