{"id":1421,"date":"2012-11-21T10:40:42","date_gmt":"2012-11-21T10:40:42","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=1421"},"modified":"2012-11-21T10:40:42","modified_gmt":"2012-11-21T10:40:42","slug":"clearing-the-quarantine-extended-attribute-from-downloaded-applications-mac-os-x","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=1421","title":{"rendered":"Clearing the quarantine extended attribute from downloaded applications Mac OS X"},"content":{"rendered":"<p>When I\u2019m packaging an application for deployment, I normally download the latest version from the vendor. If it\u2019s a drag-and-drop install, where the application is a self-contained bundle, it will get the<strong>com.apple.quarantine<\/strong>\u00a0extended attribute associated with it.<\/p>\n<div>\n<p><a href=\"http:\/\/support.apple.com\/kb\/ht3662\">The quarantine attribute is added by the OS<\/a>\u00a0so that it can ask for user confirmation the first time the downloaded program is run.\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Gatekeeper_(OS_X)\">Gatekeeper in Lion and Mountain Lion<\/a>\u00a0also uses the<strong>com.apple.quarantine<\/strong>\u00a0attribute to determine if an application should be checked (and blocked if needed.)<\/p>\n<p>To avoid issues with both unwanted messages and Gatekeeper, I normally clear this attribute as part of my packaging. Here\u2019s how to check to see if your application has the<strong>com.apple.quarantine<\/strong>\u00a0attribute associated with it:<\/p>\n<p>1. Open Terminal<\/p>\n<p>2. Run the following command:<\/p>\n<p>&nbsp;<\/p>\n<p>xattr \/path\/to\/MyApp.app<\/p>\n<p>&nbsp;<\/p>\n<p>If the\u00a0<strong>com.apple.quarantine<\/strong>\u00a0attribute is associated with the application, you should see the following output:<\/p>\n<p>&nbsp;<\/p>\n<p>computername:Applications username$ xattr \/path\/to\/MyApp.app<br \/>\ncom.apple.quarantine<br \/>\ncomputername:Applications username$<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/derflounder.files.wordpress.com\/2012\/11\/screen-shot-2012-11-20-at-10-36-34-am.png\"><img decoding=\"async\" src=\"http:\/\/derflounder.files.wordpress.com\/2012\/11\/screen-shot-2012-11-20-at-10-36-34-am.png?w=300\" alt=\"\" height=\"76\" \/><\/a><\/p>\n<p><em><strong>Note:<\/strong>\u00a0Other attributes may also be listed, with\u00a0<strong>com.apple.FinderInfo<\/strong>\u00a0being a common one.<\/em><\/p>\n<p>To remove the quarantine attribute, you would then run the following command:<\/p>\n<p>&nbsp;<\/p>\n<p>sudo xattr -r -d com.apple.quarantine \/path\/to\/MyApp.app<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"http:\/\/derflounder.files.wordpress.com\/2012\/11\/screen-shot-2012-11-20-at-10-42-11-am.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Screen Shot 2012-11-20 at 10.42.11 AM\" src=\"http:\/\/derflounder.files.wordpress.com\/2012\/11\/screen-shot-2012-11-20-at-10-42-11-am.png?w=300&amp;h=49\" alt=\"\" width=\"300\" height=\"49\" \/><\/a><\/p>\n<p>That will recursively remove the\u00a0<strong>com.apple.quarantine<\/strong>\u00a0attribute from the application. The\u00a0<strong>-r<\/strong>option will allow the quarantine attribute of all files inside the application to be selected, while the\u00a0<strong>-d<\/strong>\u00a0option causes the given attribute name (and associated value) to be removed.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>When I\u2019m packaging an application for deployment, I normally download the latest version from the vendor. If it\u2019s a drag-and-drop install, where [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1421","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1421"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/1421\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}