An executable for a XPC service embedded into a System Extension is being stripped of executable permission

I am struggling to embed an XPC service into a system extension (com.apple.developer.endpoint-security.client and a NetworkExtension). The XPC service is being embedded into the system extension bundle as part of a Framework which contains the XPC service (Embed Without Signing in XCode). The path to the XPC service executable file in the system extension bundle is Contents/Frameworks/SomeFramework.framework/Versions/A/XPCServices/SomeXPCService.xpc/Contents/MacOS/SomeXPCService

When the system extension is being registered and copied into /Library/SystemExtensions folder, the executable for XPC service is being stripped of the original executable permissions(-rwx-xr-x). The permissions for the executable are being set to -rw-r--r--, instead of original -rwx-xr-x . As a result launchd fails to start the XPC service and logs an appropriate error in the system log.

What is the correct procedure for embedding an XPC service into a system extension bundle?

The system is macOS 10.15.4 . I didn't check with other macOS versions.
Apple does not support third-parties embedding XPC Services in frameworks.

You could try embedding this directly within your sysex but it wouldn’t surprise me if it had the same problem.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
@eskimo, I am trying to make sense from your answer.

XCode does allow to embed XPC Service in a framework. Create a framework, create an XPC Service and there is an option to embed an XPC Service into a framework. So can you elaborate on what exactly is not supported by Apple?

XCode allows to embed a framework into sysex. Yet again there is an option in the XCode to embed a framework into sysex.

So we have two options supported by XCode - embed an XPC service into a framework and embed a framework into sysex. What exactly is not supported by Apple?

Can sysex make calls to xpc_connection_create, xpc_connection_resume and xpc_connection_send_message?

An executable for a XPC service embedded into a System Extension is being stripped of executable permission
 
 
Q