Matt Hudson
Matt Hudson

Reputation: 7358

Change Icon of Target in XCode

I noticed yesterday that my targets suddenly had icons (not the default A icon). However, I can't figure out what setting it was that changed it and it has now changed back to default. I changed all of the icon settings in the Info.plist, to no avail.

Upvotes: 5

Views: 10831

Answers (4)

rvijay007
rvijay007

Reputation: 1357

The issue has to do with the Info.plist not being created correctly initially. When the app icons are set in the Summary Tab, it writes to Icon Files (iOS5) Dictionary in the TARGET-Info.plist (Raw Key: CFBundleIcons). While this is recognized on devices and the simulator to store the icon information, it is not understood by XCode. Instead, we need to rename this key to Icon Files (Raw Key: CFBundleIconFiles). Renaming this will reset the app icons to be empty, so drag the icon files into their respective spots on the summary tab. Now, the icons will be set for the Target and Product (if the Product icon is not showing, Build and Restart XCode).

Then go back to the Info.plist and you will see entries for BOTH CFBundleIcons (iOS 5) and CFBundleIconFiles (additional key also called UIPrerenderedIcon). Delete the CFBundleIcons (the iOS5 one) as this is redundant.

Launch Images have to have very specific names, so these will not be in the Info.plist.

Upvotes: 0

MUH Mobile Inc.
MUH Mobile Inc.

Reputation: 1462

In the TARGET-info.plist, add the key Icon files (CFBundleIconFiles). The key "Icon files (iOS 5)" is not enough.

The value should be "icon.png" unless you have named your icon differently.

enter image description here

Upvotes: 1

A-Live
A-Live

Reputation: 8944

To reset the targets icons

  • try to find in the project all the images with the icon name from info.plist;
  • check the files Target Membership (File Inspector section)

They don't have to be in the project root. If there're several icon files at different project folders, each icon is a member of it's own target, then you have different target icons with the same icon name (and naturally the only icon file is copied to the bundle root).

Upvotes: 2

Ashley Mills
Ashley Mills

Reputation: 53231

Did you add icon.png to the root folder of your project? I think that would do it.

Upvotes: 4

Related Questions