Fix “app is damaged and cannot be opened” on macOS
Diagnose why macOS says an app is damaged, then fix it with a per-app Gatekeeper rule or by clearing the quarantine flag — without disabling system-wide protection.
What this covers
When macOS refuses to open a downloaded app with "is damaged and can't be opened", the app is usually fine — Gatekeeper is rejecting its quarantine metadata or signature. This guide walks you from diagnosis to a targeted fix.
Symptom
Check whether the app's signature is actually broken
The 'damaged' message usually means the code signature doesn't check out. Verify the bundle's signature first: a clean result points to quarantine metadata as the culprit, while a 'code object is not signed at all' or 'resource modified' result tells you the bundle itself is broken. You'll see verbose output ending in 'valid on disk' when the signature is fine.
Check whether an application bundle was signed properly and hasn't been modified since.
$ codesign --verify --deep --strict --verbose=2 /Applications/SomeApp.appLook for the quarantine flag
If the signature is valid, macOS is most likely refusing the app because of the com.apple.quarantine extended attribute that gets stamped onto anything downloaded from the internet. List the app's extended attributes to confirm the flag is present. Seeing com.apple.quarantine in the output confirms this is a Gatekeeper issue, not real damage.
See the hidden metadata Gatekeeper attaches to downloads, and understand what it means before removing it.
$ xattr -l ~/Downloads/SomeApp.app▾ Undo
$ xattr -d com.apple.quarantine ~/Downloads/SomeApp.appSee how strict Gatekeeper currently is
Knowing whether Gatekeeper assessments are enabled helps you choose the right fix: if it's strict, a per-app approval rule will work; if someone already disabled it, the problem is likely elsewhere. Run the status check and note whether it reports 'assessments enabled' or 'disabled' before moving on.
See whether Gatekeeper assessments are enabled, and control the master policy switch from the Terminal.
$ spctl --status▾ Undo
$ sudo spctl --master-enableApprove just this app through Gatekeeper
Rather than loosening Gatekeeper globally, insert a per-app assessment rule so this one tool can launch while every other download stays blocked. This is the preferred fix when the signature is valid but quarantine is blocking launch. After adding the rule, try opening the app again — it should launch without the damaged warning.
spctl --add inserts a per-app assessment rule so one tool can launch even while Gatekeeper stays strict for everything else.
$ sudo spctl --add /Applications/MyTool.app --label "Approved Tools"▾ Undo
$ sudo spctl --remove /Applications/MyTool.appClear the quarantine attribute directly
If the per-app rule isn't enough (or the app lives outside /Applications with a path the rule didn't cover), remove the quarantine flag from the bundle recursively. This directly strips the metadata Gatekeeper uses to flag downloaded apps. Success looks like the app opening normally afterward with no security prompt.
List and clear extended attributes — the quarantine flag, Finder tags, and download provenance — on any file.
$ xattr -r -d com.apple.quarantine /Applications/SomeApp.appConfirm Gatekeeper is still protecting your Mac
After fixing the app, check that the master Gatekeeper policy was never left disabled by earlier troubleshooting — the whole point of a per-app fix is that global protection stays on. The status should report assessments enabled. Then open the app once more as a final check that it launches cleanly.
Use spctl --status to see if macOS's download-app verification (Gatekeeper) is turned on.
$ spctl --status▾ Undo
$ sudo spctl --global-enableHow to confirm it worked
The app opens normally with no damaged warning, and Gatekeeper status still shows assessments enabled.
Undo everything
Every command above can be reverted. Run these in order to undo all of it.
$ sudo spctl --global-enable
sudo spctl --remove /Applications/MyTool.app
sudo spctl --master-enable
xattr -d com.apple.quarantine ~/Downloads/SomeApp.appReview before running — some steps may not be independent.
Sources
- macOS codesign — create and manipulate code signaturesEvidence: Documents codesign --verify, --deep, --strict and --display flags.
- Safely open apps on your Mac - Apple SupportEvidence: Apple's guidance on Gatekeeper app-safety checks that spctl reports on and controls.
- Code Signing GuideEvidence: Apple explains code signature validation and why deep verification checks nested code.
- Protecting users from malware on MacEvidence: Explains Gatekeeper's role in verifying that downloaded apps come from identified developers before they are allowed to run.
- xattr — display and manipulate extended attributes (macOS)Evidence: Documents -l to list all extended attributes, -d to delete one, and -r for recursive operation on bundles.
- SPCTL Command: Manage security assessment policy in macOSEvidence: Documents spctl --status, --master-enable, and --master-disable for the Gatekeeper assessment policy.
Last verified: 2026-09-21
Related guides
Use codesign and spctl to see whether a macOS app's code signature is valid, intact and acceptable to Gatekeeper.
Diagnose and fix repeated Wi-Fi dropouts on macOS using built-in terminal tools: check your connection, read signal stats, reset the interface, and verify the link holds.