http://ipaddevzone.com/cs/howto-duplicaterename-target-xcode4
Howto duplicate/rename target in XCode4
Thu, 10/20/2011 - 13:17 — root
- select project in Navigator panel
- select Target you want to duplicate
- right mouse click and choose "Duplicate"
- Rename Target in XCode: click on selected Target and inline edit starts.
- Open Terminal and go to your project directory/folder
- Run
svn status
to see the changes XCode just has made. - XCode has created new Infocopy.plist file and has added under version control if you use one. Typically you want to choose different name so follow these steps:
- Cancel version control addition:
$> svn revert Infocopy.plist
- Rename it:
$> mv Infocopy.plist YourNameInfo.plist
- Add it to version control:
$> svn add YourNameInfo.plist
- Set the new name in your new Target Build Settings named "Info.plist File"
- Cancel version control addition:
- Rename target file properly:
$> mv OrigTargetCopy.xcscheme YourTargetName.xcscheme
- Add the new target file under version control:
$> svn add YourTargetName.xcscheme
- Rename you Product in your new Target Build Settings named "Product Name"
- Very likely you will also want to set new "Preprocessor macros" Build Settings for your new Target.
- Set proper values your YourNameInfo.plist
- Set Target assignment for target specific files. Typically YourNameInfo.plist shall be part only of you new target. There may be plenty of other similar files (icon, splash screen, other graphics, etc).
Note: you can easily find new files locations by using $> svn status
. At the very beginning, you shall see new Info.plist as new Added and the new target file as not yet versioned file.
Tip: use as many Project level Build settings as possible. Override only those really Target level specific.