Home > Guides > Xcode AppIcon

Xcode AppIcon.appiconset Structure

In modern iOS development, app icons are managed inside an Asset Catalog (Assets.xcassets). The specific directory responsible for your icon is named AppIcon.appiconset.

The Contents.json File: The Brains of the Asset Catalog

Inside the .appiconset folder, you will find all your PNG files alongside a crucial file named Contents.json. This JSON file acts as a manifest, telling Xcode exactly which image file corresponds to which device and scale requirement. Without this file, Xcode just sees a folder full of meaningless images. The JSON structure is strictly defined by Apple and must be completely accurate, otherwise, your app build will fail or your icon will show up as a blank grid on the user's device.

{
  "images": [
    {
      "size": "60x60",
      "idiom": "iphone",
      "filename": "icon-60@2x.png",
      "scale": "2x"
    },
    ...
  ],
  "info": {
    "version": 1,
    "author": "xcode"
  }
}

JSON Schema Breakdown

Let's dissect the components of the Contents.json file to understand how Apple maps a physical image file to a logical requirement:

Debugging Missing App Icons in Xcode

One of the most common issues iOS developers face is the app icon failing to appear on the simulator or a physical device. If you see a generic white square with a grid, it means Xcode could not find the correct icon. Here is a checklist to debug the issue:

  1. Verify the Target Setting: Click on your project target, go to the General tab, and scroll down to the App Icons and Launch Images section. Ensure that the "App Icon" dropdown is pointing to AppIcon (or whatever you named your appiconset).
  2. Check for Warnings: Look at the Xcode issue navigator (Cmd+5). If you see a warning like "The app icon set named 'AppIcon' did not have any applicable content", it means your Contents.json is missing, malformed, or the images are the wrong size.
  3. Remove Alpha Channels: Apple strictly prohibits transparency in iOS app icons. If any of your PNG files have an alpha channel (even if it's completely filled), the App Store Connect validation will fail when you attempt to upload your archive.
  4. Clean the Build Folder: Sometimes Xcode aggressively caches old asset catalogs. Press Cmd+Shift+K to clean the build folder, delete the app from the simulator, and run it again.

Generate the JSON automatically

Writing the Contents.json by hand is tedious. Our generator outputs the exact JSON and folder structure Xcode expects.

Create Xcode AppIcon