My app contains a daemon and an agent. So once it is downloaded, my deleloper ID shows on System Settings>General>Login Items (Allow in the Background). but even after uninstalling the app, my developer ID still on the list so it can be turned off anyway.(It is understandable.) When I turn off background item(my developer ID) and reinstall the app, the background item turned on automatically but an agent from my app failed to initialize after reinstallation. On the other hand, the daemon from my app works properly.
I'm concerned that if this happen our users will have no idea why the app or the agent doesn't work even though the background item shows 'on' status.
I summarized the steps and the error messages below. It can be reproduced on Ventura beta 10&11.
- Install the app
- A Background Item is added with my developer ID
- Uninstall the app
- My app's background item is still in the Login Items section
- Turn off my app's background item.
- Reinstall my app.
- My app's background item turned on after the installation.
- An agent in my app is expected to load but it did not show up.
Error messages found from launchd.log are as follows:
2022-10-06 11:19:06.110655 (gui/501/com...**** [32250]) : Service could not initialize: Untrusted spawn was denied for /Library/LaunchAgents/com.ahnlab.v3mac.v3tray.plist, error 0xa1 - Service cannot be launched because of BTM policy 2022-10-06 11:19:06.110667 (gui/501/com...**** [32250]) : initialization failure: 22A5365d: xpcproxy + 21413 [422][59A833C0-060A-3ADE-A0C2-74CD09766F1D]: 0xa1 2022-10-06 11:19:06.110669 (gui/501/com...**** [32250]) : Untrusted service was denied launch by BTM. Removing.
com...**** is my agent in /Library/LaunchaAgents
I recommend that you file a bug about this. As you said, it’s easy to imagine your users getting confused by it.
Please post your bug number, just for the record.
One thing to keep in mind though: The “Allow in the Background” list is not a list of things that are enabled to run in the background, but a list of things that are allowed to run in the background. You can see this using the test I described in this post.
Oh, one more thing: Are you installing your items using the new SMAppService API? If not, you should give that a try. It may allow the system to track its state better.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"