Xcode - renaming project causes problem

2019-03-15 14:12发布

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.

14条回答
劫难
2楼-- · 2019-03-15 14:40

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.

查看更多
相关推荐>>
3楼-- · 2019-03-15 14:45

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).

查看更多
姐就是有狂的资本
4楼-- · 2019-03-15 14:47

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...

查看更多
三岁会撩人
5楼-- · 2019-03-15 14:47

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.

查看更多
Emotional °昔
6楼-- · 2019-03-15 14:48

In Xcode 6.3. I think you just need to make "New Scheme" in a place where you can select the device. Then save it and the project should be run on the device as well as on the simulator.

The following screenshots

enter image description here enter image description here enter image description here

查看更多
\"骚年 ilove
7楼-- · 2019-03-15 14:51

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.

查看更多
登录 后发表回答