====== Renaming Projects in Xcode ======
* see also http://docs.info.apple.com/article.html?artnum=300588
===== My Instructions =====
- duplicate the OldProject folder
- rename the new project folder to NewProject
- rename the OldProject.xcodeproj to NewProject.xcodeproj
- open NewProject.xcodeproj in Xcode
- rename the target OldProject to NewProject
- open the info panel for the target
* in the Properties tab, change the identifier if necessary
- Clean all
- close Xcode, and edit NewProject.xcodeproj/project.pbxproj in a text editor
* replace every OldProject reference with NewProject
- rename OldProject_Prefix.pch to NewProject_Prefix.pch (if it exists)
- edit NewProject_Prefix.pch in a text editor
* replace every OldProject reference with NewProject
- open Xcode, and build and run your application
- (Optional) you may need to update the following files if you have them, or if you have modified them
* InfoPlist.strings
* Credits.html
* Credits.rtf
* also, any icons or graphics with outdated images such as old program names
===== Instructions from another site =====
These instructions are adapted from the Apple instructions for the same task using Project Builder . Renaming a project in XCode is a bit convoluted, however it only takes a few minutes and is certainly quicker than recreating the project from scratch in my opinion. Here is how ...
Assume you are starting with a project named "MyWOProject" and that you want to change its name to "MyNewWOProject".
- Duplicate the "MyWOProject" directory and name it "MyNewWOProject".
- Rename the MyWOProject.xcode file inside the MyNewWOProject directory to MyNewWOProject.xcode.
- Open the MyNewWOProject project in Project Builder.
- Rename the MyWOProject target MyNewWOProject
- Make the target MyWOProject active.
- Select Edit Active Target 'MyWOProject' from the Project menu.
- Under Target Summary pane, enter 'MyNewWOProject' in Base product name.
- Under Info.plist Entries/Expert View, change the project name for NSExecutable and NSJavaPathClient properties.
- In the Groups & Files project pane, expand targets
- Select MyWOProject target and select Rename from the File menu
- Choose Clean All Targets from the Build menu.
* At this point, if you build the project, the file still has the name MyWOProject, as does the .woa directory and the URL for connecting to the application. A few more steps are necessary to complete the process.
- Quit XCode.
- Open a terminal window, and navigate (using 'cd') INTO the project (which is a unix package directory). For example...
% cd /Users/kieran/MyNewWOProject/MyNewWOProject.xcode
List the contents with
% ls -al
Open the file project.pbxproj with a text editor (such as vi for example , as I do here)...
% vi project.pbxproj
- In vi, replace all occurrences of MyWOProject with MyNewWOProject by pressing the colon key ( : ) (the colon key initiates the vi command line) and then type %s/MyWOProject/MyNewWOProject/g. So you literally type these characters (replacing with your old and new project names of course)
:%s/MyWOProject/MyNewWOProject/g
Save and exit vi by typing literally a colon, the letters 'w' and 'q'...
:wq
- Open MyNewWOProject in XCode.
- Build and run the application.