views:

117

answers:

1

I've got an Xcode project that creates a standard application that can be branded in multiple ways and contain some custom content. At the moment I have a Resource "Resources > Tour Packages" with the custom files under this. At the moment every time I want to brand the app a different way I have to delete the old files from this resource and then manually add the new versions via the XCode UI. I can't post and image but it is here - http://img.skitch.com/20100121-xub48r6e1p857c84hdrgg25dw6.jpg).

My Question: Is there a command line tool that performs the same operation?

A: 

You'd probably be better off just creating multiple targets in your Xcode project, and associating the resources for each branded version of the app with one target.

To do this, just right-click on your target and select Duplicate. You should then remove the custom resources from the Copy bundle resources build phase. You can then add a new set of resources to the Copy bundle resources build phase that are specific to the new target. You can then build any target you like by selecting it from the Active Target popup in the Xcode toolbar or by selecting it in the Project > Set Active Target menu.

This way, you can easily build different versions of your app without having complete duplicates of all your source, difference Xcode projects etc.

Rob Keniger
I guess the issue is that the resources for each project can update over time so it still requires manually updating these resources even if they are separate targets. Maybe I am better to add a build phase which copies the right files based on an environment variable.
barnaclebarnes
Yeah, this would work also. You can use the `TARGET_NAME` environment variable in your script to alter what resources are copied based on the current target.
Rob Keniger