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