Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top