Code Block A.app └── Contents └── MacOS ├── A ├── B.app │ └── Contents │ └── MacOS │ ├── B │ └── D.app └── C.app
and have the following queries
I. How to sign bundles correctly?
Should the top-level bundle be signed or signing the internal contents is enough or both? For eg: Currently, after signing any nested code, I sign frameworks (and plugins) as codesign -s xxx ABC.framework/Versions/A/ABC, which is what I believe Xcode does. However, in this thread the codesign command is run on the .framework directory.
2. How to verify that the app has been signed correctly?
I have encountered issues where the following codesign command reports no errors, but the app crashes on launch with Code Signature Invalid exception.
Code Block codesign --verify --deep --strict --verbose=2|3|4 Foo.app
3. Do Mac App Store apps need to incorporate protections required for notarization?
As per docs, Mac App Store apps don't need to go through the notarization process, are they still required to enable hardened runtime, signature timestamps etc?
4. Can helper apps have symlinks that point outside their app bundle?
In the structure that I have shared, apps B, C and D share a lot of common frameworks. Can C.app's Frameworks directory be symlinked with D.app's Frameworks directly, even though it is pointing outside C.app's bundle?
Note: This app will be distributed via the App Store
You should sign each code item separately, from the inside out. For more specific advice, see my Signing a Mac Product For Distribution post.
How to sign bundles correctly?
Doing a codesign --verify against the top-level app is a good idea. You don’t need the --deep because, if your code is nested and signed correctly, verifying the top level will verify all the nested code.2. How to verify that the app has been signed correctly?
Right. That’s typically because the code signature is valid but the code can’t be run due to sytem policy. Tracking down that problems can be quite challenging but there’s two common reasons:I have encountered issues where the following codesign command
reports no errors, but the app crashes on launch with Code Signature Invalid exception.
The code signing identity is not allowed. For example, you can’t run code signed with a distribution identity.
The code signing identity requires that the code be notarised and it isn’t.
The code uses entitlements that must be allowlisted by a profile but aren’t.
No.3. Do Mac App Store apps need to incorporate protections required for
notarization?
No. However, it’s generally a good idea to enable the hardened runtime even on Mac App Store (MAS) apps. That way you’ll flush out any problems that could cause you grief if you decide to ship a Developer ID build in the future. Indeed, many MAS developers maintain a Developer ID for their beta testing.As per docs, Mac App Store apps don't need to go through the
notarization process, are they still required to enable hardened
runtime, signature timestamps etc?
Yes, as long as the symlinks don’t point outside of the outermost bundle. However, this is not the right way to solve your problem:4. Can helper apps have symlinks that point outside their app bundle?
Rather, you should use an rpath.In the structure that I have shared, apps B, C and D share a lot of
common frameworks.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"