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/)
- Copy/rename the folder into new name
- Get inside the new folder and rename the .pch and .xcodeproj files. Example rename AppleSample.xcodeproj to MyCoolApp.xcodeproj — and — rename AppleSamplePrefix.pch to MyCoolApp_Prefix.pch
- Delete the build folder. (Using the finder)
- 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)
- Open project.pbxproj in text editor and replace all instances of the old name with the new name. Be careful not to do a find an replace. Since the default name was AppleSample, there were several references to: AppleSampleAppDelegate.h and AppleSampleAppDelegate.m. You do not want to replace these unless you also rename that file.
- Open .pbxuser where is your user name. Then repeat the previous step by renaming. I’m not sure if this is necessary. You may even be able to delete this file? But changing this file worked for me.
- Load the project file in XCode, do Build/Clean all targets
After following these steps, I was able to open the project and build it to the simulator and the device.
I had one additional problem that I came across later that required a fix. When I finially built the application for “deployment” to the App Store, I had problems signing the code. I complained that it couldn’t find the Certificate for “Scott Anguish”. I looked in the build settings and couldn’t find reference to this name. So again I opened project.pbxproj inside of MyCoolApp.xcodeproj and found 2 instances of this line:
CODE_SIGN_IDENTITY = “Scott Anguish”;
I replaced both of them with the correct code signing identity and it worked!
UPDATE: Check out this bash script which does it for you automatically:
renameXcodeProject.sh
If you like this post and would like to receive updates from this blog, please subscribe our feed.
October 9th, 2008 at 4:34 am
[...] Doug Diego placed an interesting blog post on How To Rename an iPhone XCode ProjectHere’s a brief overviewI recent created a new iPhone XCode project based off of one of the samples provided by Apple…. [...]
January 8th, 2009 at 6:13 pm
I just followed these steps, and have a couple of comments.
1. There weren’t any changes to be made in .pbxuser file. Perhaps I had already mucked around with the project settings within xcode to have taken care of this.
2. There were definitely things inside of .pbxproj that needed changing and I am certain that this was the root of my build problem where the build kept trying to find oldproj_Prefix.pch. However, after having made these changes with apple’s text editor, I can no longer open the project in xcode. xCode responds that the project file cannot be parsed. Should have made a backup copy before I started editing.
Anyway, maybe something has changed and text editing this file won’t work anymore? Just a heads up.
January 27th, 2009 at 5:47 pm
[...] If you want to rename an Xcode project, which is especially useful after copying an pasting a project, here’s how: http://dougdiego.com/2008/10/09/how-to-rename-an-iphone-xcode-project/ [...]
April 2nd, 2009 at 12:13 am
Here is a command line script to do it:
http://mohrt.blogspot.com/2009/01/renaming-xcode-project-from-command.html
April 9th, 2009 at 4:20 am
it’s great ,thanks
April 23rd, 2009 at 10:07 am
Warning. If you DO rename any files, make sure you go into all NIB (and XIB) files and update with new names. This can be a major undertaking. There are a lot of links that happen automatically. Error I got was “this class is not key value coding-compliant for the key button”. Check out this post for further discussion: http://forums.macrumors.com/showthread.php?t=556417
Bottom line – don’t change file names.
February 16th, 2010 at 11:26 pm
The processor is described as somewhat recent design number however it and also the GPU are most likely the same speed since the 3GS. The old Touch using the same CPU and GPU since the 3G was quicker. Besides getting the clock speed turned up higher the Touch has much less software to run because it is not a phone. It should beat any iPhone to this day in performance.