Hello. I'm Aleksandar Vacić, professional web developer and wine maker in the making.
Learn more about me or see what I can do for you.

My work & services

How to rename project in Xcode 3.x

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.

  1. Copy/rename the folder into new name
  2. Get inside the new folder and rename the .pch and .xcodeproj files
  3. Delete the build folder
  4. Open .xcodeproj file in text editor, like TextMate or TextWrangler. That’s actually a folder, which contains 4 files (you can also right-click and do Show package contents, which will reveal the files)
  5. Open project.pbxproj in text editor and replace all instances of the old name with the new name
  6. Load the project file in XCode, do Build/Clean all targets

Now it should be ready for new build, under new name.

tags: Programming
Comments: 15

Posted 1 year, 7 months agopermanent link

trackback URL: http://aplus.rs/programming/how-to-rename-project-in-xcode-3x/trackback/

Voices from the crowd, 15 so far

Thanks! This was easy enough, but I was trying to find a “supported” way to do it :) I wasted too much time on that!

by Jason Green
1 month, 1 week after the post

[…] I recent created a new iPhone XCode project based off of one of the samples provided by Apple. Beause of this the XCode project was called AppleSample.xcodeproj and it built an app called AppleSample.app. I wanted to rename the project and give it my own name. It’s not as easy as it sounds. Here are some instructions which are based off some instructions I found here (http://aplus.rs/cocoa/how-to-rename-project-in-xcode-3x/) […]

by Doug Diego » How To Rename an iPhone XCode Project
2 months, 1 week after the post

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…

by chumbawumba
5 months, 2 weeks after the post

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.

by Will Culpepper
8 months, 3 weeks after the post

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!

by Chris Mathews
9 months after the post

[…] Thanks to Aleksandar Vacić for posting this tutorial. […]

by xocolatl. » Blog Archive » Working with Sample Code: Rename your project in Xcode 3.x
11 months, 2 weeks after the post

Thanks for the post. It was a huge help

by Sean Barenz
1 year after the post

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.

by Tom Jennings
1 year after the post

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.

by muz
1 year, 2 months after the post

That helped a lot!, thanks!

by N.B.
1 year, 5 months after the post

Instead we can create a different target and keep all versions in same project isn’t it?

by Manjunath HS
1 year, 5 months after the post

Thanks. This post was very useful. I hope this feature gets supported in the next releases of Xcode. :)

by Paul
1 year, 6 months after the post

Now you’ve tried the hard way, try this:

In Xcode menu go to Project and select Rename.

That’s all Folks

by Carl Grainger
1 year, 6 months after the post

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

by Boon
1 year, 6 months after the post

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.

by abizer
1 year, 7 months after the post

Post your opinion


? You need to enter your email, but rest assured it will not be published.

? Enter the link and it will be published.
? This blog strives to behave properly, as per XHTML 1.0 Strict spec. You can use the following tags, but please use them wisely:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
? I have enabled comment moderation so if your comment does not shows up after you submit it, don't worry. I will review it and if it's nice and to the point, I'll approve it. This measure is up mostly to fight spam and trolls.

Tags or categories or topics...

Lots of ramblings on this blog...might be easier for you to find your juice through these tags:

Post a job. Find one. authenticjobs.com