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
.mobileconfigextension, refer the sample file in this gist - replace the UUID with your own, you can use
uuidgenin terminal to generate a new one - 2 UUIDs are required, one for the profile and one for the payload
- double click the
.mobileconfigfile 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.



If you need to enable the "from any source" function in Mac OS 15.6, enter sudo spctl --global-disable in the terminal, enter the password, go to the privacy settings and the desired item appears there. Select it and press enter. This is as clear as possible. If you can't handle it, you don't need to enable this option, trust me.