Terminal and shell

Fix "app can't be opened" on a Mac

macOS blocks apps downloaded from outside the App Store. Let one you trust through.

Fill these in once
  1. Check why it's blocked
    Terminal
    spctl --assess -vv "/Applications/Example.app"

    Rejected means Gatekeeper is stopping it.

  2. Let this one app through
    Terminal
    xattr -dr com.apple.quarantine "/Applications/Example.app"

    Only do this for apps from a source you trust.

Check it worked

  1. Open the app
    Terminal
    open -a "Example"
Undo it
  1. Block it again
    Terminal
    xattr -w com.apple.quarantine "0081;00000000;Manual;" "/Applications/Example.app"

This message is a macOS one. Linux doesn't block apps this way.

This message is a macOS one. On Windows, the similar SmartScreen warning has a More info link and then Run anyway.