I thought this would be a simple thing to do, but apparently not.
There’s no option to copy the state of the project as it is and continue working on it under the new name. The reason I need this is that I’m going through AAron Hillegass’s Cocoa Programming for Mac OS X, 3rd ed. and some of the projects span several chapters, each introducing new concepts. Thus I wanted to have each in the state it was at the end of the chapter, than compare and analyze the differences, to better understand what’s new and improved.
Since no option, we go with manual work.
- Copy/rename the folder into new name
- Get inside the new folder and rename the
.pchand.xcodeprojfiles - Delete the build folder
- Open
.xcodeprojfile in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and doShow package contents, which will reveal the files) - Open project.pbxproj in text editor and replace all instances of the old name with the new name
- Load the project file in XCode, do
Build/Clean all targets
Now it should be ready for new build, under new name.
Update (Nov 28, ’10): now there is a simple path: copy into a different folder, open the project and then in Xcode pick Project/Rename menu item. If that fails, there’s always a manual way above.





Thanks! This was easy enough, but I was trying to find a “supported” way to do it :) I wasted too much time on that!
thanks man i was looking for a solution, and this seems to be the easiest one around :)
im also following the same book as you…
Don’t forget to open your .xib files with a text editor and do a search/replace there as well.
Also rename your class files and all references inside them to be safe.
Thanks for this! It didnt work at first, so I just opened all class files and xib files and did a Cmd +F and choose to replace all old text with new, it worked great!
Thanks for the post. It was a huge help
Aleksandar, thanks for your post.
I found that I did not have to change the .pch file name … in fact if I did , the program crashed. I left it alone and everything seems to work fine.
Good jooob…
just to mention few points:
1. Its better if you first refactor the name of your delegate through xcode to new name delgate.
2. the name of header files do not get refactored u have to do those manually.
3. you have to rename plist, pch.
4. search in your project with old name in xcode and replace with new name carefully.
That helped a lot!, thanks!
Instead we can create a different target and keep all versions in same project isn’t it?
Thanks. This post was very useful. I hope this feature gets supported in the next releases of Xcode. :)
Now you’ve tried the hard way, try this:
In Xcode menu go to Project and select Rename.
That’s all Folks
I have listed the steps I normally use and you don’t have to deal with the xcodeproj file directly:
http://www.nanaimostudio.com/blog/2010/2/15/renaming-project-in-xcode-the-simple-way.html
Rather than create a slew of projects with differing names, this would have been a good chance to learn about using a source code repository. It makes comparing different states of a project much easier.
Thanks! Saved me some digging under the hood. Would just like to add that in the case of my iPhone app, I had to also rename the app delegate source files (*AppDelegate.h, and .m).
Also, if you want to give spaces in your project name, note that you can have spaces in the folder name and .xcodeproj name. In all other filenames, you need to put in underscores instead of spaces.
Thanks for putting this out there. Was a big help. Instructions are similar for AppleScript, just change source code file (instead of .sch use .applescript). I went ahead and replaced all with in the .xcodeproj package. –Michael
Aleksandar, I used your updated (simple) method and I was done in 20 seconds. Thanks!
I was breaking my head over this, till I read about the Simple Way.Thanks
This seems to have changed in xcode 4: http://stackoverflow.com/questions/5416677/renaming-projects-in-xcode-4