Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to duplicate a project target in XCode4

I want to create a target with different bundle id for test environment. I tried using the "Duplicate" function to clone a target and change the bundle id and found that the orignal one was changed too. Thanks for any tips!


================== Update =====================
Solve the link error after duplicates the target, it is a xcode bug. The quote character " is changed to \" in search paths(Building setting of the target).

see detail: http://flakasoft.com/developer-tips/xcode-4-bug-duplicating-a-target-results-in-link-error-due-to-missing-paths/

like image 679
Fourj Avatar asked Jun 29 '11 07:06

Fourj


2 Answers

Double check you have the new duplicate target selected when you modify the Bundle Identifier setting on the Info Tab. I just tried this and it worked fine.

So the bundle identifier is on the info tab, which is actually just a view of the info.pList associated with the target.

To change the info.pList on that target, you will need to make a copy of the pList file (newtarget-info.pList), go into the Build Settings tab for the target, scroll down to the Packaging segment and modify the Info.pList File setting to point to your new file.

Then when you click on the info tab you will get the settings from your newtarget-info.pList file.

like image 115
RedBlueThing Avatar answered Nov 08 '22 09:11

RedBlueThing


Figure it out.In XCode4, after duplicate the target, the info.plist file need to be duplicated too. 1. Copy the orignal info.plist file, usually "{APP Name}-Info.plist" 2. Change the setting: "Build Settings"->"Info.plist Files"

like image 4
Fourj Avatar answered Nov 08 '22 08:11

Fourj