Useful macOS defaults: Launch Services
com.apple.LaunchServices controls how macOS handles opening files and apps, including the quarantine system that warns you about downloaded files.
Turn off the "Are you sure you want to open this?" warning
When you open an app downloaded from the internet for the first time, macOS shows a warning dialog. If you find this annoying and understand the risk:
defaults write com.apple.LaunchServices LSQuarantine -bool false
This stops the quarantine warning for all future downloads. It does not turn off Gatekeeper itself. macOS still checks code signatures and notarisation. It only skips the dialog asking you to confirm.
To turn the warning back on:
defaults delete com.apple.LaunchServices LSQuarantine
What is quarantine?
When you download a file through Safari, Chrome, Mail, or most other apps, macOS marks it with a quarantine flag. This flag tells the system "this file came from the internet". The next time you open it, macOS checks the flag and shows the warning.
You can see the quarantine flag on a file:
xattr -l ~/Downloads/SomeApp.zip
Look for com.apple.quarantine in the output.
You can remove the quarantine flag from a specific file:
xattr -d com.apple.quarantine ~/Downloads/SomeApp.zip
Reset the "Open With" menu
If the "Open With" right-click menu shows duplicate entries or old apps:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
This rebuilds the Launch Services database. It takes a moment and Finder may pause briefly while it runs.
Notes
Turning off quarantine warnings reduces your protection against malware. Only do this if you trust the sources you download from and understand the trade-off.
Enjoyed this post?
Well, you could share the post with others, follow me with RSS Feeds and/or send me a comment via email.
Tags
Category:
Tags:
Year: