title: Give an OS X app a custom icon?
body: <p>Yes, my problem really is that simple. How the heck do I get my app to use the icon file or asset catalog?!</p>
  
  <p>System info:<br>
  Xcode 6.1.1 (6A2008a)<br>
  app target OS X 10.10<br>
  OS X 10.10.1 (14B25)</p>
  
  <p>This is my first OS X app but I have several years' experience developing iOS apps. </p>
  
  <p>Steps to reproduce:</p>
  
  <ol>
  <li>open Xcode, start an entirely new cocoa application project</li>
  <li>not sure this matters, but i specified my new project not to use storyboards or core data</li>
  <li>drag a .png file from my local directory into the project structure, and make sure (a) it ends up in the build target and (b) the file copies into the project's directory</li>
  <li>drag the png into the Images.xcassets catalog under any/all of the sizes classes for AppIcon.</li>
  <li>build and run</li>
  </ol>
  
  <p>Expected: app in dock and tab-switcher has the new icon.<br>
  Actual: app in dock and tab-switcher has the default "blank page with instruments A on it"</p>
  
  <p>Ok, maybe that's a DEBUG thing.</p>
  
  <ol start="6">
  <li>archive the project, show in finder</li>
  </ol>
  
  <p>Expected: app in Finder has correct icon<br>
  Actual: nope. It should be noted however that Xcode's Organizer shows the correct icon, and there does exist a file Contents/Resources/AppIcon.icns. Contents/Info.plist specifies that the Icon File is "AppIcon".</p>
  
  <p>grrr. Let's try without the asset catalog.</p>
  
  <ol start="7">
  <li>in the target's General settings, under App Icon, select "don't use asset catalogs"</li>
  <li>delete Images.xcassets</li>
  <li><p>In Info.plist, in the line for Icon File (CFBundleIconFile), specify the icon's name (in my case "AppIcon"). The documentation <a href="https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102043-TPXREF110" rel="nofollow noreferrer">clearly states</a> that</p>
  
  <blockquote>
    <p>The system looks for the icon file in the main resources directory of the bundle.</p>
  </blockquote>
  
  <p>File extension is not required here.</p></li>
  <li>build &amp; run. also archive, to save time later.</li>
  </ol>
  
  <p>Expected: app icon in dock and tab-switcher is correct.<br>
  Actual: nope<br>
  Expected: archived app has correct icon.<br>
  Actual: nope, but the archived product did have the correct png file in Contents/Resources.</p>
  
  <p>What am I missing?!</p>
  
  <p>I've tried this with .png app icons and a regular .icns file (generated by Xcode via an asset catalog). I've tried excluding and including the file extension in the Info.plist. Why is this so difficult?</p>
  
  <p><strong>Edit:</strong> Clean, Clean Build Folder and deleting the Derived Data folder did <em>not</em> help.</p>