I've downloaded some .jar files from the internet and want to use them under Mac OS X. But the OS seems to have tagged them with the extended attribute com.apple.quarantine (no indication of this until I noticed the "@" in the ls -l and figured out how to use ls -l@) -- apparently because they have been downloaded from the internet. What's the right way to deal with this?
7 Answers
You don't have to deal with it. Open it and OS X will ask for your permission. Or like richard suggested, delete it using something like:
xattr -d com.apple.quarantine my_jar.jar
To do this automatically for any downloaded file you can attach a folder action to the download folder, like described on macosxhints.com in 10.5: Remove the 'downloaded file' warning flag.
And the following was posted on macosxhints.com a long time ago, for Safari: 10.5: Disable the 'downloaded from internet' file warning, claiming one can remove VerifiedDownloadPlugin.plugin from /Library/Internet Plug-Ins. I did not test that.
As an aside: sometimes one needs to start a single program multiple times on a Mac. That can be done using cd /Applications/some-application/ followed by open -n "Application Name.app". This really needs the .app suffix; running open -n "Application Name" might get one GateKeeper stopping access:
"Application Name" can't be opened because it is from an unidentified developer.
Your security preferences allow installation of only apps from the Mac App Store and identified developers.
Above, even removing the extended attribute com.apple.quarantine does not fix that, but using the .app suffix works just fine.
(I am not advising anyone to actually get rid of the security measures.)
You can disable the warnings permanently with defaults write com.apple.LaunchServices LSQuarantine -bool false. It also disables the Gatekeeper dialogs even if you haven't allowed applications downloaded from anywhere in System Preferences.
- 42,502
- 8
- 126
- 159
I found the following command
find Application.app | while read l; do echo $l; xattr -d com.apple.quarantine "$l"; done
very helpful when trying to get rid of the attribute. Note the double quotes around $l – you need them if your apps folder contains files with a blank in their name.
- 235,242
The command xattr -cr /path/to/folder worked for me to eliminate the com.apple.quarantine issue on Mac binary upload.
- 11
Here's a corollary answer to the question asked. For .app files, the quarantine is placed when the file is run, and removed when the user grants permissions in System Preferences. However, you still can't run the .app until you move it to the Applications folder. This is useful information for when you are distributing .apps informally, but you don't want users to have to run xattr as in the accepted answer.
Here's a passive aggressive comment about this insanity.