Skip to content

Instantly share code, notes, and snippets.

@farbod-s
Last active April 12, 2025 11:58
Show Gist options
  • Save farbod-s/da8f16381f95f8664e10e0a4894eae7d to your computer and use it in GitHub Desktop.
Save farbod-s/da8f16381f95f8664e10e0a4894eae7d to your computer and use it in GitHub Desktop.
How to Fix App “is damaged and can’t be opened. You should move it to the Trash” Error on Mac
# Bypass MacOS Gatekeeper
#------------------------
#usage: xattr [-l] [-r] [-s] [-v] [-x] file [file ...]
# xattr -p [-l] [-r] [-s] [-v] [-x] attr_name file [file ...]
# xattr -w [-r] [-s] [-x] attr_name attr_value file [file ...]
# xattr -d [-r] [-s] attr_name file [file ...]
# xattr -c [-r] [-s] file [file ...]
#The first form lists the names of all xattrs on the given file(s).
#The second form (-p) prints the value of the xattr attr_name.
#The third form (-w) sets the value of the xattr attr_name to the string attr_value.
#The fourth form (-d) deletes the xattr attr_name.
#The fifth form (-c) deletes (clears) all xattrs.
#options:
# -h: print this help
# -l: print long format (attr_name: attr_value and hex output has offsets and
# ascii representation)
# -r: act recursively
# -s: act on the symbolic link itself rather than what the link points to
# -v: also print filename (automatic with -r and with multiple files)
# -x: attr_value is represented as a hex string for input and output
#-------------------------------------------------------------------
sudo xattr -rd com.apple.quarantine /Applications/MyFuckinApp.app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment