Skip to content

Instantly share code, notes, and snippets.

@hoishing
Created July 24, 2024 12:05
Show Gist options
  • Save hoishing/cadd905b095e15531467255b537f6906 to your computer and use it in GitHub Desktop.
Save hoishing/cadd905b095e15531467255b537f6906 to your computer and use it in GitHub Desktop.
disable Gatekeeper with configuration profiles in macOS 15

Disable Gatekeeper with Configuration Profiles

Starting from macOS 15, sudo spctl --master-disable is no longer supported to disable Gatekeeper.

We need to disbale it with Configuration Profiles.

How

  • Create a new configuration profile, an XML file with .mobileconfig extension, refer the sample file in this gist
  • replace the UUID with your own, you can use uuidgen in terminal to generate a new one
  • 2 UUIDs are required, one for the profile and one for the payload
  • double click the .mobileconfig file to install the profile on your Mac
  • in system pereferences -> device management, click to open the profile and enable it
  • restart the Mac

You can see in Sysytem Settigns -> Security & Privacy, allow applications from Anywhere is set.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadType</key>
<string>com.apple.systempolicy.control</string>
<key>PayloadUUID</key>
<string>FIRST-UUID-HERE</string>
<key>PayloadIdentifier</key>
<string>com.yourcompany.profile.systempolicy</string>
<key>PayloadDisplayName</key>
<string>System Policy Control</string>
<key>PayloadDescription</key>
<string>Configures System Policy Control settings</string>
<key>PayloadVersion</key>
<integer>1</integer>
<key>EnableAssessment</key>
<false />
</dict>
</array>
<key>PayloadDisplayName</key>
<string>Disable Gatekeeper</string>
<key>PayloadIdentifier</key>
<string>com.yourcompany.profile</string>
<key>PayloadRemovalDisallowed</key>
<false />
<key>PayloadScope</key>
<string>System</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>SECOND-UUID-HERE</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment