Since you’re here, you’re probably wondering how to disable this annoying pop-up that shows up every time you first run a downloaded app on the latest macOS:
In previous versions of macOS, you could disable this quarantine feature completely1 using the following command:
sudo defaults write com.apple.LaunchServices LSQuarantine -bool NO
Unfortunately, this doesn’t seem to work anymore in macOS Big Sur. As far as I can tell, there seems to be no way to completely disable quarantine natively through the system.
But here 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
(the tilde ~
is a short way to write your home folder, which is /Users/<your-username>
). 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
Whenever watchman notices a file change/addition, it will call the script, which will then remove the quarantine flag from the newly downloaded file. 🎉
A few things to note:
- This will automatically work across restarts.
- You can disable the watcher by running
watchman watch-del ~/Downloads
- This will only work for newly downloaded files, not files you’ve already downloaded before doing all this. If you want to remove the flag for already downloaded files, just run the following script once in your Terminal:
xattr -dr com.apple.quarantine ~/Downloads
This will remove the quarantine flag from all files in Downloads.
If you’re working in software development, here’s my best essay on the topic (was on the front page of Hacker News): Your source code is worthless - I know, the title is clickbaity, but it’s worth your time.
You might also be interested in my book.
Buy the book
More posts:
When hiring senior engineers, you're not buying, you're selling
Why your job description fails to attract senior engineers
- Keep in mind that anything you do on your machine is your own responsibility - this information is provided “as is” and I shall not be liable for any damages caused by using it. Yada yada, you know the drill. [return]