We use a setup with different plists for each configuration. Like this: Target-Info-Dev.plist, Target-Info-Beta.plist...
This way our configurations could have their own CFBundleDisplayName, and we can differentiate builds by app-name on device. Like this: "DEV Appname", "BETA Appname"...
However, now we are required to localize the app-name. We have done this by creating a localized InfoPlist.strings for each target:
"CFBundleDisplayName" = "<localized-appname>";
"CFBundleName" = "<localized-appname>";
But since the CFBundleDisplayName is no longer derived from Target-Info-[Configuration].plist, we cannot differentiate the app-name for different configurations.
It should be noted that we have several Targets as well, for different brands of the same app, but we already got that working by haveing a separate InfoPlist.strings for each target.
Anybody have an idea of how to accomplish both localized and configuration-based app-name?
Better Solution
CFBundleDisplayName
's value to a variable named something like$(MY_DISPLAY_NAME)
MY_DISPLAY_NAME
under User-Defined section(you need scroll to the bottom to find this section), then just expand the newly-added key, and set any name for each configuration as you wish.When building your project, every variable in the Info.plist will be replaced to its value.
The solution is much simpler than the original one.
Original Solution
I had the same requirement in my project, and then I found your question, and at last I solved it. Edit your projects' scheme, add pre-action and post-action script to execute your change. Like this,
Step 1. change app name in Build's Pre-actions
Step 2. Restore app name in Build's Post-actions
Something to explain: Debug/AdhocDevelopment/AdhocDistribution/DailyBuild are your projects' configuration names; ${CONFIGURATION} is predefined by Xcode; perl is preferable to awk and sed, which are all pre-installed on every mac OS X.
By the way, what I have done is changing appName in Info.plist, you can change your infoPlist.strings. In this way, you just need a single Info.plist file.