Wednesday, April 5, 2017

Fixing "AppName.app is damaged and can’t be opened" in macOS

Most of the suggestions (all, actually) that I've seen about fixing the "AppName.app is damaged and can't be opened" error that pops up in macOS when opening a downloaded app, go through the route of disabling GateKeeper through the following command:

sudo spctl --master-disable

The problem is that most of the times, you can fix this issue without doing dangerous things; disabling GateKeeper is never a solution, it's simply an ugly workaround.

Anyways, this issue can sometimes be fixed with another command. Normally OSX (macOS) keeps track of file metadata, such as downloaded from. The metadata can be accessed through the xattr command line program.

I ran xattr on my downloaded app:

Eltons-MacBook-Pro:Applications elton$ xattr AppName.app/
com.apple.quarantine

So I figured I could delete the attribute:

Eltons-MacBook-Pro:Applications elton$ xattr -d com.apple.quarantine AppName.app/

Next, I tried to open the app, and bam! The app loaded without a warning. So that's it!

No comments:

Post a Comment