Below applies to Mac version older than OSX 10.12.x:
Sometimes upon opening an app you've just downloaded you might see the following error: XX is damaged and can't be opened. You should move it to the Trash. This is a glitch in OS X's Gatekeeper system. Gatekeeper is designed to protect you from malware but you might see this error if you update software, or attempt to run an app that you've previously downloaded and deleted in the past.
In fact, the app isn't damaged and there's no need to delete it. The solution is as follows:
1. Open System Preferences and click the Security & Privacy icon.
2. Click the padlock icon at the bottom left to unlock System Preferences, entering your password when prompted, then ensure the General tab is selected at the top of the window.
3. Click the radio button alongside “Anywhere”, beneath the Allow Apps Downloaded From heading. You'll be warned this is insecure but, don't worry, this is only temporary.
4. Right-click the troublesome app, then select Open. Ensure the app runs for the first time.
5. Return to System Preferences, and click the radio button alongside Mac App Store and Identified Developers (or just Mac App Store, if you want total security — but this will mean you’ll need to right-click any apps you manually download in future, and right-click them and select Open).
The app is now authorized by Gatekeeper and will run fine in future.
Below applies to Mac version OSX 10.12.x and newer:
1. Open the Terminal app from the /Applications/Utilities/ folder
2. Enter the following command syntax.
sudo spctl --master-disable
3. Hit return and authenticate with an admin password if needed. You’ll now be able to open and launch apps from anywhere under macOS Sierra.
Returning to Default Gatekeeper Security in macOS Sierra:
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