I’m facing an issue with my macOS app after code signing and notarization.
The app is signed with my Developer ID and notarized using xcrun notarytool
. Everything works fine on the machine where the signing was done — Gatekeeper accepts it, no warning appears, and codesign
/spctl
checks pass.
However, when running the same .app
on other Macs, users receive a Gatekeeper warning saying the app is "malicious software and cannot be opened". The signature is valid and the notarization log shows status: Accepted.
What I've tried:
- Verified signature with
codesign --verify --deep --strict --verbose=2
- Checked notarization status via
xcrun notarytool log
- Assessed Gatekeeper trust with
spctl --assess --type execute
Everything passes successfully on the development machine.
Why would the app be treated as malicious on other systems even after notarization?
I'm happy to share logs and technical details if needed.
it sounds like you are skipping the stapling step.
That seems unlikely. Stapling is only required if the user runs the app on a Mac that doesn’t have access to Apple’s servers. I explain this in The Pros and Cons of Stapling.
7. Only after stapling, create the distribution image.
That’ll work, but my preference is to notarise the outermost container. So, if your ultimate plan is to distribute a disk image, create the disk image, sign it, notarise it, and then staple to the disk image.
There’s a lot more info about this stuff in:
Why would the app be treated as malicious on other systems even after notarization?
Gatekeeper and notarisation are separate things, and the fact that your code passes notarisation doesn’t guarantee that it’ll pass Gatekeeper.
Assessed Gatekeeper trust with spctl --assess --type execute
spctl
is not a great way to test Gatekeeper compatibility. Rather, I recommend the approach in Testing a Notarised Product.
I have a bunch of suggestions for how to debug problems like this in Resolving Trusted Execution Problems. The majority of problems like this, where notarisation works but Gatekeeper still blocks the app, are caused by the issue explained in Resolving Gatekeeper Problems Caused by Dangling Load Command Paths.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"