28
votes

I have one Xcode project (in Xcode 6.1) with a 4 targets for 4 different apps that share a lot of the same source code.

I'm trying to have each one of them show a different app icon.

Going into Project > General > [select target] > App Icons and Launch Images, I see this:

Different AppIcons

But clicking on each AppIcon, I get to the exact same app icons - not the ones that I would like for each project.

Is this just a bug in Xcode? How can I use different app icons for different targets?

6
Just found this out myself - solution is to go to each target's Images.xcassets file and define the app icons there.gabor
I have only 1 images.xcassets in xcode 7Vasil Valchev

6 Answers

26
votes
  • Click on your already existing xcassets File, where you have defined the Appicons for your first target and add a new Appicon.:

enter image description here

  • You can give the new Appicon a meaningfull name (In my case Appicon-Debug):

enter image description here

  • Go to your targets and select the new target:

enter image description here

  • choose the new AppIcon under General -> "App Icons and Launch Images" -> "App Icons Source":

enter image description here

  • Clean the project and rebuild it.
15
votes
  1. Go to your app's Assets.xcassets and create a new iOS App Icon by clicking on the + button in the bottom left corner of target's section
  2. Name it AppIcon-Test or Debug or whatever name suits you.
  3. Go to xcassets folder and in the utilities panel allow target membership to both in the File Inspector View. Make sure the all target membership's are enabled for both AppIcon sets.
  4. Select the target for which you want to change icon in the project settings. In "General" Scroll down to App Icons and Launch Images. Select your appicon set for the respective target in App Icons source

Go to your app's Assets.xcassets and create a new iOS App Icon by clicking on the + button in the bottom left corner of target's section

Name it AppIcon-Test or Debug or whatever name suits you.

Go to xcassets folder and in the utilities panel allow target membership to both in the File Inspector View. Make sure the all target membership's are enabled for both AppIcon sets.

Select the target for which you want to change icon in the project settings. In "General" Scroll down to App Icons and Launch Images. Select your appicon set for the respective target in App Icons source

Happy coding :)

6
votes

I had a similar issue when using multiple targets. Trying to change which asset set is used just didn't work, it would always just auto select the first one in the list. The way I solved this was to rename the AppIcon in each asset set e.g. AppIconMobile and AppIconTablet.

2
votes

CLick on the Arrow at right most, which will take you to Xc-assets screen, where you can set images.

Similarly click on other target and set images. If you open your project in finder window, you can notice ProjectName.xcassets where you can see different app icons set. you can copy directly to this folder aswell

1
votes

I think you just need to create Assets.xcassets for each target

Then create an AppIcon in Asset, no need to give it a different name in each asset

Select the AppIcon on the general section of each target

enter image description here

enter image description here

0
votes

On top of every other suggestions, you also need to clear Build Folder (top menu Project -> Clean Build Folder), close Xcode, remove app from device / simulator, close simulator, open Xcode and run it again. Otherwise, Xcode will keep cache of your old App Icon.