Sub topic 14
What to do when Gatekeeper blocks an app
This chapter assumes you know how Gatekeeper, code signing, notarization and the quarantine attribute fit together from the earlier chapters. You should also be comfortable opening System Settings and Terminal. The goal here is a repeatable way to handle a block without turning off protection you still need.
Read the message before you act
Gatekeeper gives different messages for different problems. The wording varies a little between macOS versions, but the cause behind each message stays the same.
| What you see | What it usually means | Can you override it? |
|---|---|---|
| "Apple could not verify the app is free of malware" or "cannot check it for malicious software" | The app is unsigned, signed without notarization, or the check could not complete | Yes, through Privacy & Security, after you vet it |
| "From an unidentified developer" | The app has no valid Developer ID signature | Yes, same route |
| "The app is damaged and can't be opened. You should move it to the Trash" | The signature is broken, the download was corrupted, or the app was modified after signing | Do not override until you know why |
| "Apple checked it for malicious software and found malware" | XProtect or the notarization service flagged it | No. Move it to the Trash |
| Blocked, and no Open Anyway button | The Mac is managed, or the block comes from a malware verdict | No, or only through your administrator |
The most important split is between "cannot verify" and "damaged" or "malware". The first means Apple has no information about the app, so the decision is yours. The other two mean a check ran and failed.
Step 1: Stop and verify
Do not click anything yet. Go back to the earlier checks and confirm what you can.
- Confirm you reached the download from the developer's official site, not a search ad or a mirror.
- Compare the file's SHA-256 hash with the published one.
- Run the signature checks on the app.
shasum -a 256 ~/Downloads/Example.dmg
codesign --verify --deep --strict --verbose=2 /Applications/Example.app
spctl --assess --type execute --verbose=4 /Applications/Example.appIf codesign --verify reports "a sealed resource is missing or invalid" or "code object is not signed at all", the "damaged" message is accurate. Delete the file and download it again. A second failure means the problem is on the server side or in transit, so do not run the app.
If the signature is valid but spctl says "rejected" with "source=Unnotarized Developer ID", the app is genuinely signed by an identified developer who skipped notarization. That is common for small open-source tools and older software, and it is the case where an override can be reasonable.
Step 2: Use Open Anyway
Recent macOS versions removed the old shortcut of Control-clicking an app and choosing Open to bypass the block. The supported route goes through System Settings.
- Try to open the app once. Dismiss the block dialog with Done. Do not choose Move to Trash.
- Open System Settings, then Privacy & Security.
- Scroll to the Security section. It shows a line such as "Example was blocked to protect your Mac" with an Open Anyway button.
- Click Open Anyway and authenticate with your password or Touch ID.
- Confirm in the final dialog by clicking Open.
The button appears only for a limited time after the failed launch, roughly an hour. If it has gone, launch the app again to bring it back. After you confirm, macOS records an exception for that specific app and does not ask again.
The Allow applications from setting
Older guides tell you to set Gatekeeper to allow apps from anywhere. That choice is hidden by default, and for good reason: it removes the check for every app, not just the one you trust. The Privacy & Security pane normally offers the App Store and identified developers options. Prefer the per-app Open Anyway exception, which limits the exposure to one app.
Removing quarantine yourself
Gatekeeper only evaluates files that carry the com.apple.quarantine attribute. You can see it, and remove it, from Terminal.
xattr -l /Applications/Example.app
xattr -dr com.apple.quarantine /Applications/Example.appThe second command removes the attribute recursively (-r) from everything inside the app. Gatekeeper then treats the app as if it had never been downloaded. This is the same override as Open Anyway, but without the confirmation dialog and without the record that you chose to trust it. Use it only after Step 1, and only on the specific app. Never paste a command like this from a web page or a chat message that tells you to run it to "fix" an installer. Fake installers use exactly that instruction to get around the check.
Edge cases
App translocation
If you open a quarantined app directly from Downloads or from a mounted disk image, macOS may run it from a randomized read-only location. The app can then fail to find its own resources or to save settings. The fix is to drag the app to the Applications folder first, eject the image, and launch the copy.
Modified apps
Editing files inside an app bundle, such as swapping an icon or patching a resource, breaks the code signature. On Apple silicon Macs this often produces the "damaged" message. If you did the modification, restore the original app. If you did not, treat the change as evidence of tampering.
Apps that were fine and now are blocked
A developer certificate can be revoked, or XProtect can add a signature for an app that was previously allowed. Updates to the app, from the developer's official update channel, usually fix the first case. In the second case the block is working as designed.
Installer packages
A .pkg is evaluated the same way. Check it before you run it.
pkgutil --check-signature ~/Downloads/Example.pkgAn unsigned package is blocked and can be approved through the same Open Anyway button. Packages run scripts with administrator rights, so they deserve more caution than a drag-and-drop app.
Decision flow
When not to override
Do not override a block in these situations:
- The app arrived by email, a chat message or a pop-up, and you did not go looking for it.
- A web page told you to drag an app into Terminal or paste a command to "allow" it.
- The checksum does not match or the signature fails verification.
- The message says malware was found.
- The software is a cracked or pirated version of a paid app. These are a common way to deliver malware, and a block is exactly the protection working.
If you decide not to open the app, move it to the Trash and empty the Trash. If you ran it before noticing a problem, change the passwords you typed on that Mac and run a scan with a reputable tool.
Exercise
You download a small open-source utility from its official project page. The checksum matches, and spctl --assess reports "rejected, source=Unnotarized Developer ID". macOS shows "Apple could not verify the app is free of malware." What do you do, and why is this safer than running spctl --master-disable?
Show answer
Dismiss the dialog with Done, open System Settings, go to Privacy & Security, click Open Anyway next to the app, authenticate, and confirm Open. The checksum and the Developer ID signature show that the file is intact and tied to an identified developer, so overriding this one app is a reasonable decision. Disabling Gatekeeper with spctl --master-disable removes the check for every app and every future download, which turns one vetted exception into a standing hole.