Hello,
I am developing a macOS Launch Daemon (packaged as a bundle) that acts as an XPC server. For debugging purposes, I am trying to run the daemon's executable directly from the terminal via sudo ./mydaemon.app/Contents/MacOS/myexecutable.
Initially, I added the com.apple.security.application-groups entitlement to the daemon. However, when starting the process, it failed to create the XPC service with the following errors:
Unsatisfied entitlements: com.apple.security.application-groups Soft-restriction provisioning profile validation failure: Error Domain=AppleMobileFileIntegrityError Code=-413 "No matching profile found" UserInfo={NSURL=, unsatisfiedEntitlements=, NSLocalizedDescription=No matching profile found}
listener failed to activate: xpc_error=[1: Operation not permitted]
To resolve the profile validation failure, I registered a new App Group in the Apple Developer Portal, generated a new provisioning profile for the daemon that includes this group, and embedded it into the bundle (Contents/embedded.provisionprofile).
Now, the previous profile error is gone, but I am getting a new identity conflict error, and the XPC listener still fails:
Two equal instances have unequal identities. <anon<myproc_name>(501) pid=2818 AUID=501> and <anon<myproc_name>(501)(262) pid=2818 AUID=262>
listener failed to activate: xpc_error=[1: Operation not permitted]
My questions are:
What exactly causes the Two equal instances have unequal identities error? I noticed the Audit UID difference (AUID=501 vs AUID=262).
Why does NSXPCListener still fail with Operation not permitted?
What is the recommended workflow for debugging a Launch Daemon that requires an App Group provisioning profile for XPC communication?
Thank you in advance!
2
0
34