When testing your app, you can enable and disable Gatekeeper using the spctl(8)
command-line tool.
To enable Developer ID-signed apps using System Preferences, go to Protect your Mac from malware.
In Terminal, enter the spctl
command.
To enable Gatekeeper, enter:
$ sudo spctl --master-enable
To disable Gatekeeper, enter:
$ sudo spctl --master-disable
Press Return.
When prompted, enter your administrator password.
In Terminal, enter the following command:
$ spctl --status
Press Return.
If Gatekeeper is enabled, the output of this command is:
assessments enabled
If Gatekeeper is disabled, the output of this command is:
assessments disabled