Starting from macOS 15, sudo spctl --master-disable
is no longer supported to disable Gatekeeper.
We need to disbale it with Configuration Profiles.
- 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