gabor
gabor

Reputation: 4349

In Xcode, how do I use a different AppIcon for each target iOS App?

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?

Upvotes: 31

Views: 12901

Answers (6)

Andy K
Andy K

Reputation: 7282

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.

Upvotes: 0

Jin
Jin

Reputation: 695

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

Upvotes: 1

Muhammad_Awaab
Muhammad_Awaab

Reputation: 1588

  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 :)

Upvotes: 17

mcfly soft
mcfly soft

Reputation: 11651

  • 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.

Upvotes: 32

Hodson
Hodson

Reputation: 3556

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.

Upvotes: 6

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

Upvotes: 2

Related Questions