I'm having some trouble getting a Login Item to launch at all.
Both the main App and the Login Item are Sandboxed. I'm launching the Login Item with the following call:
try SMAppService.loginItem(identifier: agentBundleID).register()
The call does not fail in any way, and the subsequent status of the login item is "registered", but the login item does not launch.
Then I do:
-> launchctl list | grep myapp
- 78 teamid.com.myorg.myapp.agent.debug
and
-> launchctl error 78
78: Function not implemented
and
-> launchctl list teamid.com.myorg.myapp.agent.debug
{
"EnableTransactions" = true;
"LimitLoadToSessionType" = "Aqua";
"MachServices" = {
"teamid.com.myorg.myapp.agent.debug" = mach-port-object;
};
"Label" = "teamid.com.myorg.myapp.agent.debug";
"OnDemand" = true;
"LastExitStatus" = 19968;
"Program" = "teamid.com.myorg.myapp.agent.debug";
};
The LastExitStatus 19968 doesn't tell me a lot. Just that launch services probably is not being able to find my login item for some reason.
Is there anything I can do to try and narrow this down to something I can fix?
I have a different target for our DeveloperID App and Agent (same code different targets), and that combination works just fine. The plist produced is very similar.