Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I configure my iPhone project to use a seperate application icon for beta releases

What I am trying to achieve is for the application icon to be different in builds that I send out to my beta testers, to that of the application that will be submitted for approval. This will allow me and my beta testers to easily identify the app is a beta version.

I was not sure if I should be adding a build script to modify the info.plist and change the application icon specified there. For this I guess I would have to conditional check the build type (DEBUG/RELEASE/DISTRIBUTION etc) and write the appropriate value to the plist file.

Alternatively I thought I might need to create a separate target for beta releases and specify the new BETA application icon there.

If anyone has done this kind of procedure before, any tips and ideas about how best to do it would be very much appreciated.

like image 642
Steve Wood Avatar asked Feb 23 '10 10:02

Steve Wood


People also ask

How do I release an app from the App Store from TestFlight?

To distribute using TestFlight or through the App Store, choose App Store Connect. If you are a member of the Apple Developer Enterprise Program and are ready to release your app to users in your organization, choose Enterprise. To distribute a macOS app without code signing, choose Copy App.


3 Answers

Outdated: As of September 2017, my answer is probably outdated now. Please use latest Apple developer guides relating to Asset Catalogs. Asset Catalogs are the new way of specifying image/icon resources for your app.

Original answer:

Both ways you have mentioned can be used for this purpose (Through a separate Target or using Build settings). In my opinion, the more logical way would be to use a different build configuration and set the plist file to dynamically get the icon file name from the build configuration.

Here is how I would do it:

  1. In project build settings, create a new user-defined variable called ICON_FILE (for "All Configurations")
  2. Set the value of the variable to "Icon.png" (for "All Configurations")
  3. Create a new build Configuration called "Beta".
  4. Set the value of the ICON_FILE variable to "Icon-beta.png" for "Beta" configuration.

(this will make all the configurations have the value "Icon.png" except Beta config)

In the Info.plist set the value of "Icon file" attribute to ${ICON_FILE}. This will make the info.plist dynamically get the filename from the variable you defined earlier.

In your application resources, include the beta icon with the name "Icon-beta.png" in addition to "Icon.png" you already have.

If you build the app using "Beta" config, the app will have the beta icon as the app icon.

Hope this helps!

like image 122
ravinsp Avatar answered Nov 14 '22 22:11

ravinsp


Asset catalogs can be used without creating another target.

Here are the steps I use:

1 - Create two (or more) app icon set in images.xcassets

appIcon1 appIcon2

2 - Create another configuration from project settings

demo configuration

3 - Go to Target -> Build Settings and search for app icon. You will see Asset Catalog App Icon Set Name under Asset Catalog Compiler - Options. Change the asset catalog name that will be used in new configuration.

app icon set name for configurations

4 - Build for different configurations.

simulator screen shot

like image 40
buhanserdar Avatar answered Nov 14 '22 21:11

buhanserdar


The accepted answer is not working for xcassets. So, if you already started to use xcassets catalog here is the steps:

You need to create 2 different targets of your application. To do this:

  1. Right click on your target. -> Click Duplicate (or Cmd+D)
  2. Set name of new target like MyApp-beta

Create separate icon:

  1. Go to your xcasset catalog.
  2. Right click on column with list of images -> click New App Icon
  3. Name it like icon-beta, add place here your beta icons
  4. Click on your beta-target
  5. Go to tab General -> App Icons -> select your asset icon-beta

Here it is. Now you can build your beta application!

Another advantage of this method over that described in the accepted answer - is that you can install both versions at the same time of your Application. (you need to set different Bundle Identifier for this).

like image 45
skywinder Avatar answered Nov 14 '22 22:11

skywinder