When opening a Mac app, you may see: "Your app is damaged and can't be opened. You should move it to the Trash." Don't do it—this may not mean the app is broken. It usually happens because the app isn't registered with Apple after install. Other prompts include: "Can't open 'XXX' because the developer can't be verified," "Can't open 'XXX' because it wasn't downloaded from the App Store," or "Can't open XXX because it's from an unidentified developer."
1. "Can't open 'XXX' because it wasn't downloaded from the App Store," "Your app is damaged... move it to the Trash," or "Can't open 'install' because Apple cannot check it for malware"
Fix:
01. Open Terminal.
02. Enter the following and press Return.
sudo spctl –master-disable

03. Enter your login password and press Return (the password stays hidden by default).

This effectively allows apps from "Anywhere," so macOS won't filter downloaded apps each time you open one.
If you worry about security, reopen System Preferences > Security & Privacy and select one of the first two source options—this turns off "Anywhere."

2. "Is damaged and can't be opened" on macOS Catalina
If you've already enabled "Anywhere" but still see the damaged message, your system may be macOS Catalina. Follow these steps:
Fix:
01. Open Terminal.
02. Enter the following command.
sudo xattr -r -d com.apple.quarantine /Applications/xxxx.app
Note: replace /Applications/xxxx.app with your app's path. First drag the app into Finder > Applications (its final location)—you can also drag the app into Terminal to fill the path.
3. "Can't open 'XXX' because the developer can't be verified"
01. In Finder on your Mac, locate the app you want to open.
02. Hold Control and click the app icon, then choose Open from the shortcut menu.
03. Click Open.
Note: you can also allow a blocked app by clicking "Open Anyway" in the General panel of Security & Privacy preferences.
4. Mac app unexpectedly quits
01. Open Terminal.
02. Enter the following.
sudo codesign –force –deep –sign – [file location—just drag the app in]
Example:
sudo codesign –force –deep –sign – /Applications/CleanMyMac\ X.app