While digging into how things are implemented is fun, it’s not the path to long-term binary compatibility. Do not use the code you posted in a product. Rather, follow the advice that I posted earlier, that is, look at how Xcode builds the extension and do what it does. If you do that you’ll see that the build transcript for the link step includes this: …/XcodeDefault.xctoolchain/usr/bin/clang … -e _NSExtensionMain … The causes the linker to set the main entry point to _NSExtensionMain, which is actually a symbol imported from Foundation: % nm -m Packet.appex/Contents/MacOS/Packet … (undefined) external _NSExtensionMain (from Foundation) … This techniques ensures that your extension bootstrap code is revlocked to the system, so it’ll always do the right thing. If you embed the bootstrap in your product, it might fail on future systems. IMPORTANT This is the link step for a packet tunnel provider app extension whose deployment target is macOS 15.5. You might see different commands if you bui
Topic:
App & System Services
SubTopic:
Networking
Tags: