How To Disable Gatekeeper For Open Application ANYWHERE In Mac

Anson Liao
3 min readJan 16, 2024

--

In macOS Ventura, I found the command-line sudo spctl -master-disabledoesn’t work to disable the security gatekeeper (option Anywhere ), when type sudo spctl -master-disable, it will display the message below:

Just searched in the network, found the command-line to disable the gatekeeper is changed to the new after macOS 10.15.7:

sudo spctl --global-disable

So let’s consolidate the command-line on how to enable/disable the gatekeeper for macOS.

Check gatekeeper status

To check the gatekeeper status, execute the command-line:

  • sudo spctl --status

If the gatekeeper is enabled , it will display the result:

  • assessments enabled
Gatekeeper is enabled

If the gatekeeper is disabled , it will display the result:

  • assessments diabled
Gatekeeper is disabled

Disable Gatekeeper

To enable the gatekeeper,

If macOS version is newer than or equal to 10.15.7 , can execute the command-line:

  • sudo spctl --global-disable

If macOS version is older than 10.15.7 , can execute the command-line:

  • sudo spctl --master-disable

Then can execute the gatekeeper status checking command-line to verify the result.

Also can open the Privacy & Security of the macOS System Settings to verify the Anywhere is displayed and selected or not.

Gatekeeper is disabled

Enable Gatekeeper

To enable the gatekeeper,

If macOS version is newer than or equal to 10.15.7 , can execute the command-line:

  • sudo spctl --global-enable

If macOS version is older than 10.15.7 , can execute the command-line:

  • sudo spctl --master-enable

Then can execute the gatekeeper status checking command-line to verify the result.

Also can open the Privacy & Security of the macOS System Settings to verify the Anywhere is disappeared.

Gatekeeper is enabled

Summary

Gatekeeper status checking:

  • sudo spctl --status

If macOS is older than 10.15.7 , gatekeeper:

  • enable: sudo spctl --master-enable
  • disable: sudo spctl --master-disable

If macOS is higher than 10.15.7 , gatekeeper:

  • enable: sudo spctl --global-enable
  • disable: sudo spctl --global-disable

--

--