Usually, software downloaded from the non-Mac App Store will prompt "xxx is damaged and cannot be opened. You should move it to the trash" or " xxx cannot be opened because it is from an unidentified developer" .
1. If you have the following options in the privacy and security of your Mac
Then usually choose "any source" to solve the problem that the file cannot be opened.
2. Since the Mac computer has enabled the security mechanism, by default it only trusts the software downloaded from the Mac App Store and the software signed by the developer ID, but it also prevents "honest software" without the developer's signature. Many friends do not have "Any source" option, at this time we need to open any "source option" in the terminal
1) Open "Terminal.app", enter the following command and press Enter, enter the power-on password and press Enter
sudo spctl --master-disable
This line of code tells the Mac to allow installation of apps from third-party sources.
2) After completing the above steps, open "System Preferences" - "Privacy and Security" - "Security" and make sure it has been modified to "Any Source"
3. If it still prompts that it is damaged, please perform this step on the basis of the first step in the terminal:
sudo xattr -rd com.apple.quarantine 空格 软件的路径
The path of the software can be directly found in the "Finder" - "Applications", and dragged into the terminal
Such as the Charles APP, the displayed path is
sudo xattr -rd com.apple.quarantine /Applications/Charles.app
4. If the software exits unexpectedly after updating the system, you can sign the software according to the following method
1) Open the "Terminal app" and enter the following command:
xcode-select --install
2) Sign the software
Open the terminal tool and enter and execute the following command:
sudo codesign --force --deep --sign - /Applications/Charles.app
注意:这里也要加空格
3) Error resolution
If the following error message appears:
/文件位置 : replacing existing signature
/文件位置 : resource fork,Finder information,or similar detritus not allowed
Then, first execute in the terminal:
xattr -cr /Applications/Charles.app
Then execute the following command again:
codesign --force --deep --sign - /Applications/Charles.app
Note the spaces