How to Solve the Problem of Quarantined Apps on macOS

Problem
When you try to open a newly downloaded app from the internet, the app may be prevented from launching. You will get a warning saying "<APP NAME>" is damaged and can't be opened. You should move it to the Trash.
The warning leaves no options for you to launch the app, only "Move to Trash" and "Cancel" options.
Why is this happening?
This happens because macOS automatically sets a quarantine attribute on applications downloaded from the internet. This attribute is a security measure that prevents the application from being opened until it has been verified by Apple or the user explicitly overrides the security warning.
How to solve it
There are two ways to solve this problem:
1. Override the security warning:
- Control-click the app icon and select "Open" from the context menu.
- Click "Open" again in the dialog box that appears.
This will allow you to open the application, but it does not remove the quarantine attribute. The application will still be quarantined the next time you try to open it.
2. Remove the quarantine attribute:
If the first one doesn't work, you can try to remove the quarantine attribute from the application. This will allow you to open the application without seeing the security warning.
- Open a Terminal window.
- Type the following command, replacing
<app_path>
with the path to the quarantined application:
bashsudo xattr -r -d com.apple.quarantine <app_path>
Enter your administrator password when prompted. This will remove the quarantine attribute from the application and all of its contained files and subdirectories. You will now be able to open the application without seeing the security warning.
Risks of opening apps from untrusted sources
It is important to note that removing the quarantine attribute does not guarantee that the application is safe to run. It is still possible for malicious applications to bypass the quarantine attribute and infect your system.
Therefore, you should only open applications from trusted sources. If you are unsure about the source of an application, you should not open it.
Conclusion
The quarantine attribute is a security feature that helps to protect macOS users from potentially harmful applications. However, it can also be a nuisance for users who want to install and run applications from untrusted sources.
If you are confident that an application is safe to run, you can override the security warning or remove the quarantine attribute using the methods described above. However, you should be aware of the risks involved in doing so.