How to bypass Gatekeeper with ease

πŸ•’


So in macOS they added the 'scare prompt' a while ago (OS X 10.5!!), where if you download a file from your web browser (specifically!) it will be flagged as quarantined. If you try open a 'scary' file like an executable that has the quarantine flag, you will be presented with the following prompt:

Screenshot of a macOS window. Example.app not opened. Apple could not verify example.app is free of malware that may harm your Mac or compromise your privacy.

If you're reading this, you're probably technically minded. And you know that you do in fact want to run this file. Most of the time I encounter this is when I download an open source application, and the developer hasn't signed it. Signing costs $99/year, and allows you to notarize your releases with Apple. This is not exclusive to macOS. Windows has a similar scare screen that will go away if you pay them money. Anyway.

Simplest Way: Manually Clear the Quarantine Flag

xattr -dr com.apple.quarantine ../example.app 

Breaking this down:

This will always work, but it's a little inconvenient.

Slightly Nicer Way: Quick Action

A way to make this a bit nicer is to put it in a quick action via Shortcuts. Any time you download an application, you can use the quick action in Finder to scrub the quarantine flag. The Shortcut is pretty simple, but you can download it here to save some time if you want. Just make sure to set it as a quick action in the configuration.

Diagram of how to make this quick action.

The Horrible Annoying Way (For Posterity)

The offical Apple sanctioned way to do this is to open the program, then go to System Settings, go to the "Privacy & Security" section and you'll see the "Open Anyway" button.

Screenshot of a macOS settings window. Example.app was blocked to protect your Mac. Button: 'Open Anyway'.

After this, it has the gall to show you another damn prompt. You have to click "Open Anyway" again.

Screenshot of a macOS prompt window. Open example.app. Apple is not able to verify that it is free from malware that could harm your Mac or compromise your privacy. Don’t open this unless you are certain it is from a trustworthy source. Buttons: 'Move to Bin', 'Open Anyway', 'Done'.

This way sucks but is useful if you want to instruct a non-technical user on this process.

Can I Just Disable This Completely??

Umm, I wouldn't recommend it. But I might as well include it here.

$ sudo spctl --global-disable
Password: πŸ”
Globally disabling the assessment system needs to be confirmed in System Settings.

Then you have to go to System Settings, the "Privacy & Security" section, then you can enable the "Anywhere" option:

A screenshot of System settings. A dropdown menu is shown, with the label 'Allow applications from'. In the dropdown menu are the options 'App Store', 'App Store & Known Developers' (Selected), and 'Anywhere'

If you decide to come back to the good side, you can re-enable it with sudo spctl --global-enable.

Further reading

drawing of a deer, talking to you.

I enjoy putting these at the end of my posts, cos I have to do research for most of them, and it ends up in me having a lot of browser tabs that I can then dump in here. I hope that if my post interests you, maybe other people's posts will too!
Annoyingly in this subject there is not too much high quality blog content about this, and a lot of sub-par information that will tell you to do things the annoying way.