Fix 'App Is Damaged' With xattr on Mac (Quarantine)
"AppName is damaged and can't be opened. You should move it to the Trash." Alarming — and frequently untrue. The app is often fine; what triggered the dialog is com.apple.quarantine, a flag your browser attached to the download. Here's how to inspect it, verify the app, and remove the flag when you genuinely trust the software.
Why macOS says an app is damaged
Every file a browser downloads gets tagged with the com.apple.quarantine extended attribute. The first time you open a quarantined app, Gatekeeper checks its code signature and notarization. If the app is unsigned, not notarized, or its signature doesn't check out, macOS 13, 14, and 15 show the "damaged" dialog instead of a softer warning. Nothing on disk is actually broken — Gatekeeper just refused to vouch for it.
Quarantine comes from more places than browsers, too: AirDrop transfers, Messages attachments, and mail downloads all carry the same flag. Files you create locally, or copy between folders on the same Mac, never do.
Inspect the flag with xattr
See exactly what's attached to the app:
# list extended attributes on the app bundle
xattr -l /Applications/AppName.app
A com.apple.quarantine line in the output confirms the app is quarantined. (Tip: type xattr -l then drag the app from Finder into the Terminal window — the path fills in for you.) No quarantine line? Then your problem is real damage or a broken signature, and stripping flags won't help.
The flag's value is more informative than it looks: its semicolon-separated fields record when the file arrived and which app downloaded it — Safari, Chrome, a mail client. If those details don't match how you remember getting the file, treat that as a warning sign rather than a formality.
Verify the app before you trust it
Gatekeeper exists for a reason: quarantine is the only checkpoint between a fresh download and code running on your Mac. Before removing it, ask Gatekeeper what it actually thinks:
# Gatekeeper's verdict and the signing developer
spctl -a -vv /Applications/AppName.app
accepted · source=Notarized Developer ID means Apple has scanned the app and identified its developer. rejected means macOS can't vouch for it — proceed only if you downloaded it directly from a developer you trust, over the developer's own site. If you got it from a mirror, a torrent, or you're not sure, stop and delete it.
Remove quarantine — trusted apps only
# strip the quarantine flag from the whole app bundle
xattr -dr com.apple.quarantine /Applications/AppName.app
The -r recurses through the bundle so every file inside is cleared; add sudo in front if you get Operation not permitted. The app now opens normally. Reversing it is simple: delete the app and re-download it — a fresh copy arrives quarantined again, exactly as before.
The same command works on plain files, not just apps — a downloaded shell script or command-line binary carries the identical flag, and stripping it (plus chmod +x) is what makes it runnable. Stick to -d com.apple.quarantine rather than xattr -c, which wipes every extended attribute, including harmless ones like Finder tags.
If the app arrived inside a disk image, work on the copy you dragged into /Applications, not the .dmg itself — quarantine propagates from the image to everything extracted from it, so stripping the image after the fact does nothing for the app you already copied out.
One more distinction worth knowing: if the dialog says the app is from an unidentified developer rather than "damaged", you don't need Terminal at all. Right-click the app, choose Open, or approve it under System Settings → Privacy & Security → Open Anyway. Save xattr for the "damaged" case, where those routes aren't offered.
While you're tuning your Mac, Mainspring turns 90+ hidden macOS settings into labelled, reversible toggles — signed, notarized, and never on Gatekeeper's wrong side.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
When the app really is damaged
If xattr -l shows no quarantine flag, or the error persists after stripping it, the download itself is likely corrupt or the app's signature is genuinely broken. Re-download from the official source first — and for the full decision tree, see every fix for the "app is damaged" error.