How host app and system extension communicate with each other?

new to Apple, MacOS, SystemExtensions. I don't see anything about my topic in system extensions documentation. should I use XPC? or we have a better way here?

Accepted Reply

should I use XPC?

Yes.

You tagged your question with both Endpoint Security and Network Extension, so it’s not clear which one you’re creating. Or perhaps you’re creating both. Regardless, both allow your sysex to publish a named XPC endpoint. With ES it’s via the NSEndpointSecurityMachServiceName, per the EndpointSecurity man page. With NE it’s via NEMachServiceName, which you can see in the NE template.

Share and Enjoy

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

  • thank you for your answer

    and I have one more question

    when i try to load a network extension(data filter)

    i stuck at the request to system, system didn't finish my request, send a user prompt or something.

    i use "systemextensionctl list" , found that corresponding extension was in "validating by category" status.

  • and i check the system log: 2024-03-13 17:40:13.468430 +0800 sysextd waiting for external validation of extension with identifier com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.470535 +0800 nesessionmanager Validating system extension com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.517456 +0800 sysextd returning cdhash for local arch arm64 of extension com.a.ExtsLoadTestTool.HNetDataFltExt how to solve this problem?

  • Have solved this problem by creating a new project...

Add a Comment

Replies

should I use XPC?

Yes.

You tagged your question with both Endpoint Security and Network Extension, so it’s not clear which one you’re creating. Or perhaps you’re creating both. Regardless, both allow your sysex to publish a named XPC endpoint. With ES it’s via the NSEndpointSecurityMachServiceName, per the EndpointSecurity man page. With NE it’s via NEMachServiceName, which you can see in the NE template.

Share and Enjoy

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

  • thank you for your answer

    and I have one more question

    when i try to load a network extension(data filter)

    i stuck at the request to system, system didn't finish my request, send a user prompt or something.

    i use "systemextensionctl list" , found that corresponding extension was in "validating by category" status.

  • and i check the system log: 2024-03-13 17:40:13.468430 +0800 sysextd waiting for external validation of extension with identifier com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.470535 +0800 nesessionmanager Validating system extension com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.517456 +0800 sysextd returning cdhash for local arch arm64 of extension com.a.ExtsLoadTestTool.HNetDataFltExt how to solve this problem?

  • Have solved this problem by creating a new project...

Add a Comment

and i check the system log: 2024-03-13 17:40:13.468430 +0800 sysextd waiting for external validation of extension with identifier com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.470535 +0800 nesessionmanager Validating system extension com.a.ExtsLoadTestTool.HNetDataFltExt 2024-03-13 17:40:13.517456 +0800 sysextd returning cdhash for local arch arm64 of extension com.a.ExtsLoadTestTool.HNetDataFltExt how to solve this problem?

What are all the logs here? It looks like nesessionmanager is looking at your bundle to evaluate if it's properly structured. Is there any other logs?

  • Hello. Sorry, i can't recurrent this problem. i have delete the old project.

    all i remember is that in log output the log above appeared about every ten seconds.

    In addition, the old project is actually the SampleEndpointApp and I add a data filter network extension target to it.

    now i create a new project and everything works well.

Add a Comment