XPC issue with System extension process

I have a project with two processes: a UI app (non root) and a system extension (root). The XPC communication between them is functioning correctly.

Now, I want to add another process for a different task. I created a new XPC target (HelperProcess) in Xcode and set up an XPC connection between the UI process and this new HelperProcess, which works fine.

However, when I try to establish an XPC connection between the HelperProcess and the system extension, it fails. I used the same steps I did to set up the XPC connection between the HelperProcess and the UI process. Specifically, I am using initWithServiceName: to identify the process for communication, but this approach only fails for the system extension and not for the UI part.

I’m presuming, based on this thread’s tags, that your sysex is hosting one or more NE providers. Lemme know if that’s not the case.

However, when I try to establish an XPC connection between the HelperProcess and the system extension, it fails.

Is your XPC service sandboxed?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

yes, it is having NE provider, and yes the helperprocess(xpc service) is sandboxed.

Thanks for confirming.

A sandboxed process can’t make outgoing XPC connections to arbitrary named endpoints. To make this work you must prefix the XPC endpoint name with an app group ID. For example, my Team ID is SKMME9E2Y8 and thus I might:

  • Have the sysex publish the SKMME9E2Y8.my-product.my-group.xpc name.

  • Have the XPC service connect to that name.

  • And then sign the XPC service with an app group of SKMME9E2Y8.my-product.my-group.

If you’re coming from iOS, be aware that app groups on macOS are weird. See App Groups: macOS vs iOS: Fight! for the gory details.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

XPC issue with System extension process
 
 
Q