Enable and disable Developer ID apps and Gatekeeper

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.

Enable and disable Gatekeeper using the spctl command

  1. In Terminal, enter the spctl command.

    To enable Gatekeeper, enter:

    $ sudo spctl --master-enable

    To disable Gatekeeper, enter:

    $ sudo spctl --master-disable
  2. Press Return.

  3. When prompted, enter your administrator password.

Check Gatekeeper status using the spctl command

  1. In Terminal, enter the following command:

    $ spctl --status
  2. 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
See alsoDistribute outside the Mac App Store (macOS)Sign a Mac Installer Package with a Developer ID certificateTest a Developer ID-signed app