{"id":28829,"date":"2020-04-29T16:04:21","date_gmt":"2020-04-29T20:04:21","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=28829"},"modified":"2023-03-06T09:53:58","modified_gmt":"2023-03-06T14:53:58","slug":"actool-strips-larger-icon-sizes","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2020\/04\/29\/actool-strips-larger-icon-sizes\/","title":{"rendered":"actool Strips Larger Icon Sizes"},"content":{"rendered":"<p><a href=\"https:\/\/twitter.com\/macguru17\/status\/1253439645251141632\">Max Seelemann<\/a>&rsquo;s App Store upload failed because the high-resolution versions of the icon were missing:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/macguru17\/status\/1253439645251141632\">\n<p>It turns out, the icons <em>actually<\/em> were not there&#8230; but obviously we had them in the source asset catalog. We didn&rsquo;t change the asset catalog or how icons are created in months.<\/p>\n<p>[&#8230;]<\/p>\n<p>It started dawning on me&#8230; if we didn&rsquo;t notice others might not have as well? A quick check in the app folder&#8230; yep, other recently updated apps like \n@pixelmator, \n@vectornator, or \n@dayoneapp\n show the same problem. It even affects Apple&rsquo;s own apps like KEYNOTE!<\/p>\n<p>[&#8230;]<\/p>\n<p>1) iconutil requires images in an &ldquo;iconset&rdquo; to be named like &ldquo;icon_16x16.png&rdquo; etc. &#x2013; actool seems to be more flexible (but strips the larger sizes)<\/p>\n<p>[&#8230;]<\/p>\n<p>2) Seems that Finder no longer takes the app&rsquo;s icon from the icns file. Instead, it reads the embedded asset catalog (if there is any).<\/p>\n<p>So you can&rsquo;t just add an .icns file and use it &#x2013; if you have an asset catalog, the icon must be compiled in.<\/p>\n<p>3) You cannot compile an app icon in an asset catalog without actool also writing the icns file. Whatever you do &#8230; you need to <em>replace<\/em> that icns file in later build phase.<\/p>\n<\/blockquote>\n\n<p>I haven&rsquo;t been using asset catalogs because, last I checked, they <a href=\"https:\/\/forums.developer.apple.com\/thread\/29406\">don&rsquo;t work with frameworks<\/a>. There&rsquo;s no public API to look up an image in a given asset catalog; it only checks the one at the top level.<\/p>\n\n<p>See also:<\/p>\n<ul>\n<li><a href=\"https:\/\/bjango.com\/articles\/assetcatalogs\/\">Improving asset catalogs<\/a><\/li>\n<li><a href=\"https:\/\/blog.timac.org\/2018\/1018-reverse-engineering-the-car-file-format\/\">Reverse engineering the .car file format (compiled Asset Catalogs)<\/a><\/li>\n<\/ul>\n\n<p>Update (2020-04-29): I don&rsquo;t know how I missed this, but the <code>Bundle.image(forResource:)<\/code> API seems to work for looking up images in a framework.<\/p>\n\n<p id=\"actool-strips-larger-icon-sizes-update-2020-05-19\">Update (2020-05-19): <a href=\"https:\/\/twitter.com\/macguru17\/status\/1255603056286339072\">Max Seelemann<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/macguru17\/status\/1255603056286339072\">\n<p>Btw my understanding by now is that either <em>all<\/em> app&amp;document icons must be .icns or <em>all<\/em> inside asset catalogs. You cannot mix the two. So if I had removed all file icons from the asset catalog, Finder would have fallen back to using the ICNS file.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Max Seelemann&rsquo;s App Store upload failed because the high-resolution versions of the icon were missing: It turns out, the icons actually were not there&#8230; but obviously we had them in the source asset catalog. We didn&rsquo;t change the asset catalog or how icons are created in months. [&#8230;] It started dawning on me&#8230; if we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2020-04-29T20:04:24Z","apple_news_api_id":"e7156f62-b735-470b-a241-627234afcdbb","apple_news_api_modified_at":"2023-03-06T14:54:01Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAw==","apple_news_api_share_url":"https:\/\/apple.news\/A5xVvYrc1RwuiQWJyNK_Nuw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[2352,131,69,458,545,653,30,1666,71,226],"class_list":["post-28829","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-asset-catalog-car","tag-bug","tag-cocoa","tag-finder","tag-icons","tag-itunes-connect","tag-mac","tag-macos-10-15","tag-programming","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/28829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=28829"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/28829\/revisions"}],"predecessor-version":[{"id":28981,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/28829\/revisions\/28981"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=28829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=28829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=28829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}