pushplay

interactive · design · studio


< Back to Main

How to change an iPhone App name from XCode

July 22, 2009
|

Problem:

Changing a project name (or an app name) for a project you're developing in XCode can become a cumbersome task, with random errors showing up and the old name appearing when you least expect it. I've come up with a method that seems to be effective in doing a complete rename and ensuring it "takes"...

Solution:

The following is my "foolproof" way of changing the name of an XCode app in development. It's pretty much the easiest, and most consistent way that I've found to do it.

The key is knowing that every file in an XCode project is either an XML file, or a straight text file (like a class).

Part of what helps is that I tend to name projects (and apps) simple one-word names (like Pinhole, Contraculate, or the soon-to-be-released Putterball).

I start by renaming all of the files with the old app name to the new app, such as:

(from)

testApp_Prefix.pch
testApp.xcodeproj
textAppViewController.xib
Classes/testAppAppDelegate.h
Classes/testAppAppDelegate.m
Classes/testAppViewController.h
Classes/testAppViewController.m

(to)

newApp_Prefix.pch
newApp.xcodeproj
newAppViewController.xib
Classes/newAppAppDelegate.h
Classes/newAppAppDelegate.m
Classes/newAppViewController.h
Classes/newAppViewController.m

Control-click the newApp.xcodeproj file. One of the options will say "Show Package Contents". Drag these files into TextEdit to open them.

Then, I drag *every* other file (except the .xcodeproj) into TextEdit.

Once they're all open, I do a Find-Replace All (from "testApp" to "newApp") and I save each file.

This is a manual process, but it seems the easiest way to ensure that the new app name is taken (and the old one is completely blown out). I've tried a number of different techniques that I had found on the internet, but this is simply the most effective (for me, anyway).

4 Comments

29 Aug
2009
luca
Very usefull!
I used textmate to make the job.
Thanks a Lot.
29 Aug
2009
Ian
If you need to change the name of the Application as it appears on the iPhone's home screen, you need to do it in the Target configuration, not the project configuration. Expand the Targets group in Xcode, then single-click the item under that. It should share the name of your project, which is also the default name of the application that gets generated.

Press command-I to bring up the Info window, then navigate to the Build tag. Set the Configuration drop-down to read All Configurations, then look for a setting called Product Name under the Packaging heading. Change that value to the name you want for your compiled applications and, in the immortal words of Bugs Bunny: Viola! Do a clean then build and your application will take on the new name.
29 Aug
2009
AJ
This was useful for me as well. I just wanted to mention, for anyone as dim as me on this stuff.

If you are using Interface Builder, your nib file may be connected by name to the old appDelegate you were using.

My app wouldn't compile or run properly, until I went into Interface builder, and changed the name there. Not sure why the search and replace didn't' find that for me, but it didn't
11 Sep
2009
Suzanna Diebes
Regarding the nib files - I ran into that problem,the trick here is to actually open up the xcodeproj which contains three files. Search through these files and replace the old project path with the new project path.

Submit a Comment:

Your Name:
Email Address:
Comments:
Enter what you see: Verification Image