{"id":5473,"date":"2014-05-29T17:41:46","date_gmt":"2014-05-29T16:41:46","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=5473"},"modified":"2014-05-29T17:41:46","modified_gmt":"2014-05-29T16:41:46","slug":"the-mechanism-behind-open-foo-app-on-mac-os-x","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=5473","title":{"rendered":"The mechanism behind `open foo.app` on Mac OS X"},"content":{"rendered":"<p>If you type<\/p>\n<pre>open foo.app<\/pre>\n<p>in a Mac terminal window, or alternatively, click on foo.app in Finder the application foo will be launched.<\/p>\n<p>It turns out that foo.app is actually a directory which made me wonder <em>&#8216;What determines what gets launched?&#8217;<\/em><\/p>\n<p>If you look inside an .app folder, you will find a Contents folder. Inside this will be, among other things, a file called <strong>Info.plist. \u00a0<\/strong>It is this file that determines what gets launched. For example, there is an entry in this file called <strong>CFBundleExecutable<\/strong> that determines the executable to be launched.<\/p>\n<p>Full details at\u00a0<a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Carbon\/Conceptual\/LaunchServicesConcepts\/LSCConcepts\/LSCConcepts.html#\/\/apple_ref\/doc\/uid\/TP30000999-CH202-TP9\">https:\/\/developer.apple.com\/library\/mac\/documentation\/Carbon\/Conceptual\/LaunchServicesConcepts\/LSCConcepts\/LSCConcepts.html#\/\/apple_ref\/doc\/uid\/TP30000999-CH202-TP9<\/a><\/p>\n<p>Thanks to <a href=\"https:\/\/twitter.com\/BeaumontChris\">Chris Beaumont<\/a> for the link above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you type open foo.app in a Mac terminal window, or alternatively, click on foo.app in Finder the application foo will be launched. It turns out that foo.app is actually a directory which made me wonder &#8216;What determines what gets launched?&#8217; If you look inside an .app folder, you will find a Contents folder. Inside [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[75,26],"tags":[],"class_list":["post-5473","post","type-post","status-publish","format-standard","hentry","category-apple","category-mac-os-x"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-1qh","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5473"}],"version-history":[{"count":1,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5473\/revisions"}],"predecessor-version":[{"id":5474,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/5473\/revisions\/5474"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}