Post not yet marked as solved
Post marked as unsolved with 8 replies, 3,064 views
I was trying out SMAppService on macOS Ventura to register LaunchDaemons and LaunchAgents.
Apparently I didn't get it quite right 🙈 So now I am in a situation where I registered a LaunchDaemons (it showed up in System Settings > General > Login Items) and did not throw an error on registering, but it doesn't really work and I am not able to unregister it.
SMAppService.unregister() returns SMAppServiceErrorDomain Code 113 "Could not find the specified service". The SMAppService instance I am trying to use for unregistering was created the same way that I registered, using SMAppService.daemon(plistName: "some.plist").
Is there any way to reset the state or remove the broken daemon config manually? I tried removing all copies of my app from the system and rebooting, but that didn't clean it out.