This is a continuation of my own old post that became inactive to regain traction. I am trying to resolve issues that arise when distributing a macOS app with a SysExt Network Extension (Packet Tunnel) outside the App Store using a Developer ID Certificate.
To directly distribute the app, I start with exporting the .app via Archive in Xcode.
After that, I create a new Developer ID provisioning profile for both the app and sysext and replace the embedded ones in the .app package.
After I have replaced the provisioning profiles and the have the entitlements files ready, I start signing the frameworks, sysext and parent app.
codesign --force --options runtime --timestamp --sign "Developer ID Application: <name>"<app>.app/Contents/Library/SystemExtensions/<sysext>.systemextension/Contents/Frameworks/<fw>.framework/Versions/A/<fw>
codesign --force --options runtime --timestamp --sign "Developer ID Application: <name>" <app>.app/Contents/Frameworks/<fw>.framework/
codesign --force --options runtime --entitlements dist-vpn.entitlements --timestamp --sign "Developer ID Application: <name>" <app>.app/Contents/Library/SystemExtensions/<sysext>.systemextension/Contents/MacOS/<sysext>
codesign --force --options runtime --entitlements dist.entitlements --timestamp --sign "Developer ID Application: <name>" <app>.app
After validation is successful with
codesign --verify --deep --strict --verbose=4 <app>.app
I zip the package, notarize and staple it
ditto -c -k --keepParent "<app>.app" "<app>..zip"
xcrun notarytool submit <app>.zip --keychain-profile “”<credents> --wait
xcrun stapler staple <app>.app
After that I finish creating signed and notarized .dmg/.pkg.
hdiutil create -volname “<app>” -srcfolder “<app>.app/" -ov -format UDZO ./<app>.dmg
codesign --force --sign "Developer ID Application: <name>" <app>.dmg
xcrun notarytool submit <app>.dmg --keychain-profile "<credentials>" --wait
xcrun stapler staple <app>.dmg
Then when I move the .dmg to a clean system, open the .dmg, move the .app to the Applications folder, the attempt to run it fails with “The application “” can’t be opened.”. When I look into the console, the gatekeeper disallows the launch job with the message:
86127 debug ProvisioningProfiles taskgated-helper ConfigurationProfiles entitlements: {
"com.apple.developer.networking.networkextension" = (
"packet-tunnel-provider-systemextension"
);
"com.apple.developer.system-extension.install" = 1;
"com.apple.developer.team-identifier" = <teamid>;
"keychain-access-groups" = (
“<teamid>.<app>.AppGroup"
);
} com.apple.ManagedClient
<app>: Unsatisfied entitlements: com.apple.developer.networking.networkextension, keychain-access-groups, com.apple.developer.system-extension.install, com.apple.developer.team-identifier
LAUNCH: Runningboard launch of <app> <private> returned RBSRequestErrorFailed, error Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x600001a25830 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}, so returning -10810
I went through all possible formats (macOS-Style and iOS-Style App Group IDs) and combinations of appgroups according to the post “App Groups: macOS vs iOS: Working Towards Harmony”. But none of those work for me. The weird part is that when I try the same steps on different developer account, I am able to get the app running. What can be wrong?
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
Network Extension
Gatekeeper
Code Signing
Developer ID