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.



A reply to off topic passive-aggressive comment
@ilgam111 Are you getting some kind of extra points for these comments?The
spctl --global-disableno longer works starting from Sequoia (15.x) — it even says so in the title:Why do you insist on pointing people in the wrong direction? Maybe actually try yourself before patronizing others?
The
profiles installwas is disabled; I'm guessing this is just to steer people towards using paid MDMs 😒