What’s the intended execution environment for this privileged code?
In my experience most privileged code on macOS eventually ends up running via a launchd daemon, and if that’s the case then it’s better, in my experience, to let
launchd
run your daemon and then attach to it with the debugger. The execution environment for a launchd daemon is very different than the execution environment for, say, code run via
sudo
.
There’s specific affordance for this in both Xcode (“Wait for executable to be launched”) and
launchd
(the
WaitForDebugger
key in the
launchd property list).
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"