0

I'm working on an IOS project where we need to generate different branded or customized applications from the same source project. Such customization consists of different images, strings, application name, and (possibly) different developer ID.

According to the information I've found searching the web, the preferred way to do this is to add targets to the project, which seems pretty straightforward as a manual task. However, my intend is being able to add targets using some command line tool or script so that the process of generating a customized or branded app can be automatized.

For example, let's say I'm want to generate a branded app for some company, which has to include their logos, brand names, etc. The desired way to do this would becreating a configuration file where the customized parameters are specified (applogo='logo.jpg'; appname='brandedApp'; ...), and then calling a script that will take such config file as parameter and (after some steps still unknown for me) will compile the project, generating the branded application. The idea is performing this branding task pretty often, so entering the app parameters would be the only manual step in this process.

Is there any way I can accomplish this? As far as I know, there is no way to add/edit targets to a XCode project from command line, but maybe I'm wrong on this.

And, is there any classic approach to solve this problem?

Thank you very much.

2 Answers2

0

Look into project settings->build phases, you can run a script before/after building your project. You can also create various XCode targets for different logo/appname. This is the most 'elegant' and only way for now.

I'm also building same App for different publishers with different logo/name. Apple DID provide some methods to build targets in command line in lower version of XCode, but it's not avaliable for newer version since XCode 4(it's been a long time, hope my memory is right).

Shane Hou
  • 4,808
  • 9
  • 35
  • 50
  • Thank you very much. Given that you're branding same app for different publishers, I have one more question for you. Do you have a different bundle identifier for each app, or you reuse the same bundle ID?. If not, do you have to associate each app's bundle ID to your provisioning profile? Sorry for the newbie question, but I'm a little lost here. Thanks. – user2262133 Apr 11 '13 at 10:17
  • Surely you have to make different `Bundle identifier` for different targets. Each targets' bundle ID is associated with provisioning profile automatically. – Shane Hou Apr 11 '13 at 10:24
0

Basically, I won't go into deep details, you need to create a new Target. Add your branded images and new localization files to Target Membership(press CMD-Alt-1) and you will see target membership.

This way, only the files that belong to the target membership will be compiled for each Target.

mskw
  • 10,063
  • 9
  • 42
  • 64