title: Why does Xcode ignore my .xcassets larger sizes for my app icon in an OS X app project?
body: <p>I am tearing my hair out trying to set up a custom icon for my OS X app.  I have created all of the image files needed:</p>
  
  <pre><code>mondrian_128x128.png
  mondrian_128x128@2x.png
  mondrian_16x16.png
  mondrian_16x16@2x.png
  mondrian_256x256.png
  mondrian_256x256@2x.png
  mondrian_32x32.png
  mondrian_32x32@2x.png
  mondrian_512x512.png
  mondrian_512x512@2x.png
  </code></pre>
  
  <p>I have dragged each image into the appropriate well in my AppIcon xcassets area, and all ten images now appear there.  (The ones larger than 32x32@2x all get displayed at the same size as the 32x32@2x one in Xcode, but perhaps that is as it should be; I am guessing Xcode does that to conserve screen real estate, since displaying a 1024x1024 image would take up the whole window.)</p>
  
  <p>When I inspect these images in Xcode, by clicking on each well, it shows information in the inspector area that appears to be good – the correct name, size, scale, etc.  Similarly, the .json file inside the .xcassets looks good:</p>
  
  <pre><code>{
    "images" : [
      {
        "size" : "16x16",
        "idiom" : "mac",
        "filename" : "mondrian_16x16.png",
        "scale" : "1x"
      },
      {
        "size" : "16x16",
        "idiom" : "mac",
        "filename" : "mondrian_16x16@2x.png",
        "scale" : "2x"
      },
      {
        "size" : "32x32",
        "idiom" : "mac",
        "filename" : "mondrian_32x32.png",
        "scale" : "1x"
      },
      {
        "size" : "32x32",
        "idiom" : "mac",
        "filename" : "mondrian_32x32@2x.png",
        "scale" : "2x"
      },
      {
        "size" : "128x128",
        "idiom" : "mac",
        "filename" : "mondrian_128x128.png",
        "scale" : "1x"
      },
      {
        "size" : "128x128",
        "idiom" : "mac",
        "filename" : "mondrian_128x128@2x.png",
        "scale" : "2x"
      },
      {
        "size" : "256x256",
        "idiom" : "mac",
        "filename" : "mondrian_256x256.png",
        "scale" : "1x"
      },
      {
        "size" : "256x256",
        "idiom" : "mac",
        "filename" : "mondrian_256x256@2x.png",
        "scale" : "2x"
      },
      {
        "size" : "512x512",
        "idiom" : "mac",
        "filename" : "mondrian_512x512.png",
        "scale" : "1x"
      },
      {
        "size" : "512x512",
        "idiom" : "mac",
        "filename" : "mondrian_512x512@2x.png",
        "scale" : "2x"
      }
    ],
    "info" : {
      "version" : 1,
      "author" : "xcode"
    }
  }
  </code></pre>
  
  <p>When I build my app, however, things seem to be messed up.  No build warnings or errors appear, but the built product does not have any but the smallest sizes.  Specifically: AppIcon.icns, which is generated by Xcode, seems to have only the 16x16 and 16x16@2x images.  I can see this by doing a QuickView of it in the Finder (as Apple recommends), or by opening it in Preview.  Furthermore, the app itself, when I select it in the Finder, shows a blurry icon that is clearly scaled up from the small icon.  And when I use NSApplicationIcon in an NSImageView in a panel, the icon displayed is tiny.  The larger sizes have clearly not been copied over.</p>
  
  <p>I've spent all morning reading about .xcassets on the web, watching a YouTube video on how to assemble them, and (of course) looking at Apple's rather unhelpful documentation.  I can't for the life of me figure out what I'm doing wrong.  Any ideas?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I'm now experimenting with trying to get iconutil to make the ICNS, in the hopes of understanding why Xcode can't do it properly.  I copied my AppIcon.appiconset to my Desktop and tried "iconutil -c icns AppIcon.appiconset".  It said "AppIcon.appiconset:error: Invalid Iconset.".  I changed the name to "AppIcon.iconset" in case that was an issue, and it changed its error to "AppIcon.iconset:error: Failed to generate ICNS."  It occurred to me that maybe the images need to have the same name as the name of the .iconset, so I changed them all from starting with "mondrian" to starting with "AppIcon".  Still getting "AppIcon.iconset:error: Failed to generate ICNS."  Sure would be nice if iconutil printed out more helpful error messages.</p>
  
  <p>I also just opened all of the image files in GraphicConverter, added an alpha channel, and saved them back out, thinking that perhaps an alpha channel was required (although I have seen no mention of that anywhere – but most apps do have alpha in their icon, so...).  Again, no change: "AppIcon.iconset:error: Failed to generate ICNS.".  Aargh.</p>
  
  <p><strong>UPDATE 2:</strong>
  It now works.  I'm not sure why.  I added the modified images (alpha channel added, saved in GraphicConverter instead of from Photoshop Elements) that were in my experimental .iconset on my Desktop back into the AppIcon in the .xcassets of my Xcode project, cleaned and built, and it is now all good.  iconutil still refuses to compile it to an ICNS, but Xcode can now do it.  I have no idea why.  Maybe something about the state of my project was corrupted, or maybe alpha was needed, or maybe GraphicConverter saves PNG files in a way that Xcode likes better than Photoshop Elements' format.  Mysteries abound.  Anyway, perhaps this record will be helpful to someone else in a similar situation.</p>