Basically, I used the native Safari.app web browser to download a third party application and I want to run / open it from the comfort of my bash shell / Terminal.app CLI; despite the following error message:

“<unidentified_thirdparty.app>” 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. Safari downloaded this file on <today's_date> 
 from <the.inter.net>.

You'll either have to change the settings under System Preferences > Security & Privacy > General > Allow applications downloaded from: to Anywhere or in a Terminal, strip the xattr com.apple.quarantine attribute from the downloaded file(s).

xattr -dr com.apple.quarantine "unidentified_thirdparty.app"
  • I was aware of the GUI method. The next part looks spot-on though. What exactly does the com.apple.quarantine (attribute) argument refer to? – tjt263 Sep 8 '15 at 2:21
  • @tjt263, Sorry I didn't see your comment until now... All filesystem objects have attributes, e.g. information you'd see in the output of the ls -l file command. Filesystem objects also have extended attributes of which com.apple.quarantine is one that is assigned to objects downloaded from the Internet by OS X to help prevent arbitrary execution and thus one level of protecting the system. Using ls -lR@ file or xattr −lr file will show extended attribute information the latter of which will output more extensive information. See man xattr for more information. – user3439894 Jan 31 '16 at 14:17
  • Wow. That's interesting. I did not know about that. Do other Operating Systems have something like this in place? – tjt263 Jan 31 '16 at 18:21
  • You can also use either right-click (aka ctrl-click) and choose "Open", to allow executing just that app. – Hawken Rives May 1 '16 at 1:19
  • 1
    @HawkenRives, Yes it does as it's a global setting not the actual running or opening of the file as the right-click on the file does. Using xattr portion of my answer cover the command line and Terminal. – user3439894 May 1 '16 at 1:32

Enter this in the Terminal under a administrator account: sudo spctl --master-disable

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • This turns off Gatekeeper completely. And it is not an answer to the question. – pjc90 Sep 1 '17 at 7:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.