简体   繁体   中英

How do I change the product name within an Xcode project?

I have an application that I would like to be called IFrames. I've named all of the files appropriately (IFramesAppDelegate, etc.), but when I run it in ad hoc mode it shows up with the name "photoframes" instead.

How did this happen and how do I change the name of the product to match the name I've provided for the project?

In XCode 4, on the Target properties, it is under the "Packaging" section, or you can just search for "Product Name".

在此输入图像描述

Do not set the product name on the project level, since your project can build several different applications. For example on iPhone/iPod touch app, and another iPad app fromt he same sources.

Instead set the product name on the Target. Find the Target in the Group & Files column in Xcode. And select "Get Info" from the context meny, or use the cmd-I shortcut.

目标

In the Info window go to the build tab. Make sure Configuration is set to "All Configurations", since you want the same name for Debug and Release builds. Filter down your options with "product name" to find the option fast, and type away.

目标信息中的产品名称

In Xcode 5, the Product Name defaults to the variable $(TARGET_NAME) which is linked to your Target Name.

You can change your Target Name by clicking your Project in the Project Navigator, then clicking the target in the list under Targets, and hitting return .

This part isn't necessary, but if you rename your project it will sit there annoying you every time you see it (like it did me all this morning)--the scheme name at the top when you compile the project will still have the old name. You can rename it too like this:

在此输入图像描述

Click the name and select Manage Schemes :

在此输入图像描述

Click on the name and you can overwrite it:

在此输入图像描述

You should check all setting/value in the "Project Info" & "Target Info" Pop-up.

Another solution, Right-Click on your .xcodeproj, Open the Dir (because it isn't a file), Open all files with text-edit and search/replace what you want :-)

Good Luck !

您还可以通过在最新版本的XCode中选择Project-> Rename来更改整个项目名称。

Go to Project -> Edit Project Settings -> Select Build tab -> look for productName in packaging category.Change it to what you want.

Same way Change it in Edit Active Target Settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM