How to Set an iOS App Icon in Xcode
This article explains how to set the app icon for an iOS app in Xcode.
As an example, I'll set the following app icon for an app called AnimalPics.
Apple's Guidelines for iOS App Icons
First, here are some key points from Apple's guidelines for iOS app icons. Please check Apple's official site for full details.
- Keep the icon design as simple as possible.
- Make sure the icon immediately identifies your app.
- Make it clear what the app does at a glance.
- Do not round the corners yourself. The system will apply rounded corners automatically.
- Avoid text in the icon, or keep it to a minimum.
- Do not use photos or screenshots as the icon.
- Do not make the icon look like an Apple product.
- Do not reuse the app icon for other UI elements. Instead, use your app's theme colors in the UI.
- Check how the icon looks against various wallpapers.
- Keep the background simple and do not use transparency.
Regardless of design, remember two important rules: do not round the corners yourself, and do not use transparency.
In particular, transparency may seem fine when testing in the simulator or on devices connected to Xcode, but when you try to submit to the App Store you may encounter an error:
ERROR ITMS-90717: Invalid App Store Icon
.
For the solution to this error, see How to Solve ERROR ITMS-90717: Invalid App Store Icon.
Create the Base Image for the App Icon
First, create the base image for your iOS app icon.
The largest size required is the App Store icon: 1024 × 1024 pixels.
Use your preferred image editor to design a 1024 × 1024 app icon.
Remember, keep the corners square. The system will round them automatically.
Save the app icon as a PNG file with transparency disabled.
If you're not sure how to disable transparency, you can turn off alpha when exporting in the Mac Preview app.
In Preview, go to File > Export, then uncheck the Alpha checkbox before saving.
Generate iOS App Icons in Different Sizes
iOS app icons require multiple sizes for different devices.
Open your project in Xcode, go to the left navigator area, select Assets.xcassets, and then select AppIcon.
You will see the required icon slots for each device type.
You could resize and save each image manually, then drag and drop them into each slot. However, there are many online tools that can generate all required iOS app icon sizes at once.
Search for “iOS app icon generator” and you'll find several options.
For this example, I used the App Icon Generator website: upload a 1024×1024 image, select the target devices, click Generate, and download the results.
Set the App Icon in Xcode
Now let's set the generated iOS app icons in Xcode.
Open the project in Xcode, go to the left navigator, select Assets.xcassets, and then select AppIcon.
If you manually created icons in each size, drag and drop them into the appropriate slots.
If you used a generator, unzip the downloaded file. You should see a folder structure like this:
In Xcode, select AppIcon and delete it with [Delete Selected Items].
Then drag and drop the [AppIcon.appiconset] folder from the unzipped package into the AppIcon slot in Xcode.
Xcode will automatically configure the icons in all required sizes.
If something goes wrong, delete the AppIcon you added, right-click in the area, and select [iOS] > [iOS App Icon] to restore the AppIcon slots. You can then configure them manually if needed.
Install the App and Verify the Icon
Once the app icon is set, install the app to check how it looks.
In this example, select the iPhone 11 simulator and click the button.
The app will install and launch. Open the home screen by clicking the home icon in the top right corner.
The configured app icon is now visible in the simulator.
That's how to set a custom app icon for your iOS app in Xcode.