I have a swift app which uses SMJobBless with kSMDomainSystemLaunchd to install a privileged helper tool which performs some actions which require root. My app talks to it over XPC using NSXPCConnection. I embed the helper tool under Contents/Library/LaunchServices
When building my app under macOS 13.2.1 with Xcode 14.2, installing the helper tool with SMJobBless no longer works. A copy of the app built on earlier macOS / Xcode does work fine.
- Can I use SMAppService.agent() ? The helper does not need to run when the user logs out. It only performs some actions as root when invoked over XPC and can exit afterwards.
- Is there some workaround to make SMJobBless work as before?
- If I use SMAppService.agent, where do I put the plist file?
- In which directory should I embed the tool executable if I use an agent?
- How should the plist file look like for a XPC launch agent?
- Can I have a working example xcode project which uses SMAppService.agent() to embed a privileged helper?