Adding App Icon to Xcode for Tahoe

I have designed a new icon for my app/Tahoe in Icon Composer (launched from within Xcode)but I simply cannot get it to show up. The documentation for Icon Composer spends a lot of time describing how to design the icons but goes distressingly vague/silent on how one might use it. It suggests that I should drag the file to Xcode and it will guide me as to where to put it.

The app continues to use the old (pre-Tahoe) icon.

I don't get any change of behaviour and I don't know what to name the file. I assume that there are no other settings that I have to change. I can't find anything on the web or in Apple's documentation: maybe I'm missing something obvious!

My app is a working NSDocument-based Cocoa project.

Any suggestions please.

Tahoe 26.0.1, Xcode 26.0.1, Apple M1 Max MBP.

Answered by DTS Engineer in 863724022

I created a new one, with the default name and inserted it at the top level of my project. I was then able to import the icon file that I called IconFile.

After you create an App Icon using Icon Composer, drag it to the project navigator in your Xcode project. You don't add it to your Asset catalog.

To resolve your issue, follow these steps:

  1. Follow the steps in Creating your app icon using Icon Composer to create an app icon.
  2. Drag the app icon into the project navigator in your Xcode project.
  3. In the Build Settings pane, set Primary App Icon Set Name (ASSETCATALOG_COMPILER_APPICON_NAME) to the name of your app icon with no file extension.

Please see the Configuring Your App to Use Alternate App Icons sample code that demonstrates how to integrate app icons created using Icon Composer.

Thank you for the quick response that seems to have moved me forward quite a lot. Sadly it still doesn’t work.

My project had an asset catalogue containing the old icon files (called images.xcassets) that I deleted. I created a new one, with the default name and inserted it at the top level of my project. I was then able to import the icon file that I called IconFile. That name is consistent with the name in Project > General; I did not tick “Include all icon assets”.

This didn’t work, even after a restart the old icon was still displayed. I then found that the icon file entry in my …-info.plist file still referred to the old icon (that I had removed) so I changed that to AppIcon.icon. That didn’t work either.

I cleaned the build folder, the app still runs but has a blank icon (being the outline containing the glass template in white on a pale grey background).

Assets.xcassets contains one item being the AppIcon. This is displayed as its three layers plus icon.json that references these and looks credible as the icon file.

Any pointers on where to go next would be greatly appreciated. I haven’t seen any diagnostics that seem relevant except a message that I think is long-standing at build time: “cannot open file at line 51040 of [f0ca7bba1c]” - I don’t see enough information there to follow it up.

Observation: The page you pointed me to in Xcode Help does not appear when searching on “icon”. Presumably why I didn’t find it.

Observation: the process described for creating an asset catalogue is out of date in https://developer.apple.com/documentation/xcode/managing-assets-with-asset-catalogs.

Accepted Answer

I created a new one, with the default name and inserted it at the top level of my project. I was then able to import the icon file that I called IconFile.

After you create an App Icon using Icon Composer, drag it to the project navigator in your Xcode project. You don't add it to your Asset catalog.

To resolve your issue, follow these steps:

  1. Follow the steps in Creating your app icon using Icon Composer to create an app icon.
  2. Drag the app icon into the project navigator in your Xcode project.
  3. In the Build Settings pane, set Primary App Icon Set Name (ASSETCATALOG_COMPILER_APPICON_NAME) to the name of your app icon with no file extension.

I followed the steps suggested above and they made no difference: still no icon when launched. However, after I tried quitting/restarting Xcode and cleaning the Build Folder the app icon showed correctly. Excellent - thank you.

My intention is to keep the older app icon for legacy macOS versions so I reinstated my Assets.xcassets and inserted the various resolutions of the original app icon. Emboldened, I also set (to YES) the 'Include All App Icon Assets' build switch. Sadly the old icon does not show in testing on Ventura 13.7.8, only the new one. I repeated this with the build setting as NO with the same result.

In the meantime, my app size has ballooned as the Assets.car file has grown to 3.4MB vs 749KB in my last build on the previous version of Xcode (the latest pre-V.26).

How should I include the older icons? What has changed to inflate the .car file - all I have done is add the new icon and fiddle with the build settings as described in this thread?

My intention is to keep the older app icon for legacy macOS versions so I reinstated my Assets.xcassets and inserted the various resolutions of the original app icon. Emboldened, I also set (to YES) the 'Include All App Icon Assets' build switch. Sadly the old icon does not show in testing on Ventura 13.7.8, only the new one. I repeated this with the build setting as NO with the same result.

That is expected. The latest version of Xcode uses the Icon Composer file instead of an existing AppIcon asset catalog in your project.

I have read elsewhere that it is possible to keep the older icon for previous versions of macOS. However, I see that a .icns file has been created inside the app containing a single bitmap rendering of the glass icon. Presumably this is what Apple intends to be used so I shall stay with that.

I still have the issue of the Assets.car file that has grown from my last (pre v.26) build - now 2.9MB vs 749KB previously. I have no catalogues in my project now.

Any clues on where this may have come from? Is there an "official" way to inspect its contents?

Thanks again for your help that has got me to a working, albeit large, Tahoe version of my app. I hope this thread may help others also having problems with including a glass app icon in older projects.

Any clues on where this may have come from? Is there an "official" way to inspect its contents?

To view the content of your Assets.car, enter xcrun assetutil --info Assets.car in Terminal:

% xcrun assetutil --info Assets.car

To learn about the assetutil command, enter xcrun assetutil in Terminal:

% xcrun assetutil  

Thank you. The .car file is full of icons, including a variety of sizes of PNG versions of the app icon. It looks like all of this is intended and will presumably melt away as I remove support for older versions of macOS.

It's very useful knowing how to examine the contents of a .car file for future reference too.

I will close this support case now, your timely and specific answers have been invaluable.

Adding App Icon to Xcode for Tahoe
 
 
Q