Apple devices tend not to like it when you try to install software that the company hasn't vetted. iPhones and iPads won't do it at all unless you jailbreak them, and even Macs do so only under protest.
By default macOS allows you to open apps from the official App Store only, and even if you go into System Preferences > Security & Privacy and change the setting for 'Allow apps downloaded from' to 'App Store and identified developers' you'll still be prevented from opening anything macOS doesn't recognise.
This all helps improve security, since dodgy apps are a common malware vector, but can be a pain if you've obtained software from a trusted but unofficial source and just want to run it with no fuss. Fortunately, it's straightforward enough to override macOS's security measures and install and open an app from an unidentified developer.
But be warned: do this only if you are satisfied that the developer and software (and the means of distribution, since innocent apps can be hijacked by guilty parties) are legit. We discuss the safety of unidentified apps later in this article.
Open the app in System Preferences
If you attempt to open a mystery app and macOS stops you from doing so, you can jump to System Preferences and override the block.
Open System Preferences and go to Security & Privacy, and make sure the General tab is selected. (You'll see that this is the same page where you tell macOS to allow apps from identified developers as well as from the App Store.)
If you've been blocked from opening an app within the past hour, this page will give you the option to override this by clicking the temporary button 'Open Anyway'. You'll be asked one more time if you're sure, but clicking Open will run the app.
This creates an exception for that app, so you'll also be able to open it in the future without having to repeat this process.
Use a shortcut
A quicker way of doing this can be to locate the app file in Finder and Ctrl-Click it. If you select Open from the resultant menu, the app will be opened anyway, and an exception will be created for opening it normally (i.e. by double-clicking) in future.
It might be, it might not. The point is that you don't have Apple's certification that it is, so you will have to rely on your own due diligence to ensure that the software is okay.
Before installing the software you should search for reviews of the app, information about the company (and distribution site/platform), and advice and testimonials from other users. Bear in mind as ever that dodgy companies are not above planting a few fake reviews to give themselves the sheen of legitimacy, so keep searching after the first few results. If you're not satisfied, it may be safer to find an alternative that macOS is happier to install.
When installing unidentified apps you should also make extra-sure that your AV software is up to date.
Note that getting the 'unidentified developer' warning dialog doesn't mean you're about to install some malware. As Apple acknowledges, there are plenty of reasons why a perfectly legitimate company might not be on the identified list; it might for instance just be older than the company's developer registration programme.
How to 'Allow Apps from Anywhere'
As you can see above, the Security & Privacy section of System Preferences presents you with two settings for the types of apps you allow to run: ones from the App Store, or ones from the App Store or identified developers.
But there is a third, hidden option: 'Allow apps from anywhere'.
We will say right away that we don't recommend this setting, which puts you at risk of installing malware under the guise of legitimate software. But if you are determined on this course, it's possible to make that option reappear with a line of code in Terminal.
Open Terminal and enter the following:
sudo spctl --master-disable
Now press Return, and you will be asked to enter your password. Once that's done, open System Preferences (if it's already open, you'll need to quit it and restart to see the new options) and go to the Security & Privacy section.
A new, third option will have appeared allowing you to 'Allow apps downloaded from: Anywhere'. You'll have to click the padlock icon to make changes to the settings on this page.
How to remove the 'Anywhere' option
If you share your Mac with someone else it might be wise to get rid of the Anywhere option. To hide it again, you'll need to go to Terminal again, and this time type:
sudo spctl --master-enable