{"id":1076,"date":"2011-01-11T12:28:03","date_gmt":"2011-01-11T03:28:03","guid":{"rendered":"http:\/\/www.codedojo.com\/?p=1076"},"modified":"2011-01-11T12:28:03","modified_gmt":"2011-01-11T03:28:03","slug":"fixing-bad-file-permissions-for-mac-app-store-submission-when-using-xcode-folder-references","status":"publish","type":"post","link":"https:\/\/www.codedojo.com\/?p=1076","title":{"rendered":"Fixing bad file permissions for Mac App Store submission when using Xcode folder references"},"content":{"rendered":"<h2>The problem<\/h2>\n<p>You compile your app and test it.\u00a0 It works great!\u00a0 Time to submit to the Mac App Store, right?<\/p>\n<p>Not yet.\u00a0 Before submission, use<strong> Build and archive<\/strong>, <strong>Share<\/strong> from Xcode organizer, then install the resulting .pkg file.\u00a0 (Side note:\u00a0 Delete your app from everywhere first if you actually want it to install it right, otherwise it will get confused and install over existing versions, probably the one you made with build and archive!)<\/p>\n<p>Uh oh.\u00a0 The 60 mb file installed only 6 mb of stuff. \u00a0 Huh?!<\/p>\n<h2>The solution<\/h2>\n<p>I suspect this only happens to people who are using folder references with data coming from a smb windows share.<\/p>\n<p>The issue happens because the folder references in the .app get funky file permissions and while the app works fine, the pkg installer fails to copy &#8217;em.<\/p>\n<p>To fix it, right click the build target and choose<strong> Add-&gt;New Build Phase-&gt;New Run Script Build Phase<\/strong> and put something like the following in it:<\/p>\n<p><a href=\"..\/wp-content\/uploads\/2011\/01\/fixing-mac-permissions.png\"><img loading=\"lazy\" decoding=\"async\" title=\"fixing-mac-permissions\" src=\"..\/wp-content\/uploads\/2011\/01\/fixing-mac-permissions-300x223.png\" alt=\"\" width=\"300\" height=\"223\" \/><\/a><\/p>\n<p>[php]<br \/>\n\ufeff\ufeff\ufeff\ufeff\ufeffset -ex<br \/>\nif [ &quot;${CONFIGURATION}&quot; = &#8216;Release&#8217; ]; then<\/p>\n<p>[ &quot;$ACTION&quot; = build ] || exit 0<br \/>\n[ &quot;$BUILD_VARIANTS&quot; = &quot;normal&quot; ] || exit 0<\/p>\n<p>chmod -R o+rX,g+rX &quot;$BUILT_PRODUCTS_DIR\/Dink Smallwood HD.app\/Contents\/Resources&quot;<br \/>\nfi<br \/>\n[\/php]<\/p>\n<p>A google search on this esoteric issue failed me so I&#8217;m posting this in the hopes of helping you, dear random googler, in your time of need.<\/p>\n<h2>Dink Smallwood HD coming to Mac one way or another<\/h2>\n<p>Oh, and yeah, I&#8217;m trying to get Dink HD on the Mac App Store.\u00a0 It will be a free app.\u00a0 It will probably be rejected because of the DMOD support (downloading user levels) but I have to try.<\/p>\n<p>If rejected, I guess I&#8217;ll just release normally as a download from here, but that&#8217;s too bad as I really like the auto-updating\/ratings features of an App Store.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The problem You compile your app and test it.\u00a0 It works great!\u00a0 Time to submit to the Mac App Store, right? Not yet.\u00a0 Before submission, use Build and archive, Share from Xcode organizer, then install the resulting .pkg file.\u00a0 (Side note:\u00a0 Delete your app from everywhere first if you actually want it to install it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,12,16,6],"tags":[],"class_list":["post-1076","post","type-post","status-publish","format-standard","hentry","category-development","category-dink","category-proton","category-tech-tips"],"_links":{"self":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1076"}],"version-history":[{"count":10,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions"}],"predecessor-version":[{"id":1087,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=\/wp\/v2\/posts\/1076\/revisions\/1087"}],"wp:attachment":[{"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codedojo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}