How to disable quarantine completely in macOS?

Posted on

QUESTION :

In macOS Big Sur (v11.2.3), how can I completely disable the following warning (see screenshot), for all applications I ever download? Yes, I know of the potential security risks, and I’m willing to take them.

I’ve tried:

sudo defaults write com.apple.LaunchServices LSQuarantine -bool NO

And I’ve also completely disabled Gatekeeper:

sudo spctl --master-disable

I tried rebooting my system, but still, macOS keeps adding the quarantine flag to any new files I download (I’m not concerned about old ones I’ve already downloaded). What else can I try?

screenshot

ANSWER :

Unfortunately, I haven’t found a way to do this natively. But as @Spiff recommended in the comment above, there is a workaround:

First, install Homebrew, if you haven’t already. Then, run the following three commands in your Terminal:

brew install watchman
watchman watch ~/Downloads
watchman -- trigger ~/Downloads removequarantine '*' -- ~/remove-quarantine.sh

The first command will install watchman, an open-source file watching tool.
The other two commands will set up a watcher for the Downloads folder. Anytime a file is added or modified in that folder, watchman will call the script in ~/remove-quarantine.sh. We still have to create that script. Using a text editor, create a new file and name it remove-quarantine.sh, place it in your home folder, and add the following line to it:

xattr -dr com.apple.quarantine ~/Downloads/$1

You can find more details in a blog post I made about this.

Leave a Reply

Your email address will not be published. Required fields are marked *