views:

1528

answers:

10

I'm currently working on an iphone application. I started working on this from a project template that I found on the internet. Now I want to rename this project. I've successfully renamed the actual project file, folder and the executables and some other stuff, but there is one weird problem. If I try running the application on my iphone device, Xcode refuses to run the executable with the new name - it's trying to run the old one with the old name instead, and thus it happens that it says: "No launchable executable present at path." Which is true, since the path is wrong (wrong name). The weird thing is that it works on the iphone simulator - it's using the correct executable path.

Any help would be appreciated.

+3  A: 

Renaming Xcode projects can be an absolute nightmare. I personally feel that the best way to "Rename" a project is to create a new Xcode project and copy in the necessary files. I know this seems inconvenient, but it's the most straight-forward approach that I know of.

Currently, renaming a project involves doing a couple of find/replaces on the project, and changing things in the project settings.

I would love if Xcode automated this for you. This is one thing where Eclipse really shines as an IDE.

Good luck!

Reed Olsen
+4  A: 

http://aplus.rs/cocoa/how-to-rename-project-in-xcode-3x/

I found that to work quite well. Basically, if it's only the executable name you want to change, then open the main project file (the .xcodeproj) as a folder (right click > show package contents), and open the files in there. Then search them for (regular expression this) product.*name, and for each item you find, replace that which is on the right side of the equal sign to what you want your executable file to be named.

I used the text editor smultron for that. Awsome program...

quano
Thanks for the pointer to http://www.tuppis.com/smultron/ -- looks like a nice little editor!
artlung
see Colin's answer, in XCode 3.2.1 there is the "Project->Rename" feature
marked
+1  A: 

What I would suggest you do is just rename the Product. Right click Project then Build -> Packaging -> Product Name. Updating this Product Name should be enough.

nicktmro
Yeah, it *should* be enough. However, that was what caused this problem in the first place, that Xcode does change the executable name to product name, *BUT* Xcode tries to launch the old executable. If you search through the files I mentioned above, you'll see that product name occurs more than one time, and in those results, you'll see that only one was changed to the name you specified in the project properties.
quano
+2  A: 

Go for this link.

http://www.thohensee.com/?page_id=180

This link not only provides the way of renaming the project. It also provides the details of changing executable name. Try it. I have implemented it in my project.

Point to be Noted :

Suppose old Name is "Sagar_RK"

& New Name is "SagarRK"

Project will be renamed, but you need to remember following thing.

When you use shared application delegate. You must have to take delegate with old name application delegate.

For example

Sagar_RKAppDel *t=(Sagar_RKAppDel*)[[UIApplication sharedApplication] delegate];

Try it out.

Best of luck.

sugar
A: 

This tutorial from phonegap on renaming projects seems pretty good. It seems to point out all the areas that need a change. I don't think it matters whether or not you're renaming a phonegap project or a normal project.

phonegap tutorial

Neo42
Thanks, I found this useful for renaming an Xcode project under version control where "Project->Rename..." was causing problems. Not sure why this answer was downvoted.
titaniumdecoy
+6  A: 

In 3.2.1 on Snow Leopard, there is a "Project->Rename..." menu item that works like a charm. I think it was introduced in 3.2. Shame that it's Snow Leopard only.

Colin Gislason
Doesn't work for me, various resources have not been renamed
david
I just attempted this on 3.2.1 and it worked great! Thanks Colin!
marked
+1  A: 

I just want to add to the above answers that Apple have made this relatively easy in XCode 3.2 - just rename the whole project in Project->Rename and also change the product name in the project settings...

...but after doing that, I still got the 'No launchable executable...' message.

The key is to restart XCode after this point (it seems actually necessary to do this), and everything should be okay.

Just hoping this saves someone a few minutes of confusion!

retcon
A: 

Not to be negative but the one thing about XCode that sucks is all the bugs. I'm hoping XCode 4. Is a total rewrite and thus more stable. At best some of the XCode releases have amounted to betas.

In any event you have good responses to your question. Venting.

Dave

David Frantz
+1  A: 

One thing I had to do, after I thought everything was renamed everywhere was go to:
Project - > Edit Active Target

Then edit the "Product Name" field under Packaging (on the build tab).

JordanC
A: 

This is what I found helped me: http://drjunker.org/2008/04/10/xcode-rename-project-and-application-change-copyright-and-version-number/. Notice the comment by John Beatty (jcb) - it's an important addition to the steps described in the post.
And this is an in-depth post explaining the various kinds of clones you'd want to make, and how to do them. Very informative.

Lea Cohen