复制xcode4工程

来源:互联网 发布:ubuntu apt get glib 编辑:程序博客网 时间:2024/05/02 02:43

http://ipaddevzone.com/cs/howto-duplicaterename-target-xcode4


Howto duplicate/rename target in XCode4

  1. select project in Navigator panel
  2. select Target you want to duplicate
  3. right mouse click and choose "Duplicate"
  4. Rename Target in XCode: click on selected Target and inline edit starts.
  5. Open Terminal and go to your project directory/folder
  6. Run svn status to see the changes XCode just has made.
  7. 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"
  8. Rename target file properly: $> mv OrigTargetCopy.xcscheme YourTargetName.xcscheme
  9. Add the new target file under version control: $> svn add YourTargetName.xcscheme
  10. Rename you Product in your new Target Build Settings named "Product Name"
  11. Very likely you will also want to set new "Preprocessor macros" Build Settings for your new Target.
  12. Set proper values your YourNameInfo.plist
  13. 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.