- M: Brand new device
- F: Refurbished device
- N: Replacement device.
sudo spctl --master-disable
You’ll now be able to open and launch apps from anywhere under macOS Sierra, but be forewarned this turns off Gatekeeper and is not recommended for the vast majority of Mac users. Allowing apps from anywhere including unidentified developers can potentially leave a Mac vulnerable to certain malware and junkware and should be avoided by all Mac users with the exception of those with genuinely advanced abilities.
Another approach is to manually add Gatekeeper exceptions via the command line, a solution which may be more appropriate than simply allowing everything to skirt past Gatekeeper.
You can also reverse this and go back to the default strict Gatekeeper settings of only allowing apps from the Mac App Store and identified developers by issuing the following command string:
sudo spctl --master-enable
Hitting return and re-authenticating will return macOS Gatekeeper back to its strict default state of disallowing random apps from launching.
Nearly every Mac user should leave this feature enabled in the default state. If you do not have the ability to easily discern which apps are legitimate or not, you should absolutely not change this option. The “app can’t be opened because it is from an unidentified developer” message is there to offer protection to the vast majority of Mac users and should not be ignored.