如何在 Xcode 项目中更改产品名称?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3872175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I change the product name within an Xcode project?
提问by Pankaj Kainthla
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.
我有一个应用程序,我想将其称为 IFrame。我已经适当地命名了所有文件(IFramesAppDelegate 等),但是当我在临时模式下运行它时,它会显示名称“相框”。
How did this happen and how do I change the name of the product to match the name I've provided for the project?
这是怎么发生的,我如何更改产品名称以匹配我为项目提供的名称?
采纳答案by PeyloW
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.
不要在项目级别设置产品名称,因为您的项目可以构建多个不同的应用程序。例如在 iPhone/iPod touch 应用程序上,以及来自相同来源的另一个 iPad 应用程序。
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.
而是在 Target 上设置产品名称。在 Xcode 的 Group & Files 列中找到 Target。然后从上下文菜单中选择“获取信息”,或使用 cmd-I 快捷方式。
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.
在信息窗口中,转到构建选项卡。确保配置设置为“所有配置”,因为您希望调试和发布版本具有相同的名称。使用“产品名称”过滤您的选项以快速找到选项,然后输入。
回答by Jay Imerman
In XCode 4, on the Target properties, it is under the "Packaging" section, or you can just search for "Product Name".
在 XCode 4 中,在 Target 属性上,它位于“Packaging”部分下,或者您可以只搜索“Product Name”。
回答by TalkLittle
In Xcode 5, the Product Name defaults to the variable $(TARGET_NAME)
which is linked to your Target Name.
在 Xcode 5 中,产品名称默认$(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.
您可以通过在项目导航器中单击您的项目,然后单击目标下列表中的目标并点击 来更改您的目标名称return。
回答by James Toomey
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
:
单击名称并选择Manage Schemes
:
Click on the name and you can overwrite it:
单击名称,您可以覆盖它:
回答by Vinzius
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 :-)
另一种解决方案,右键单击您的 .xcodeproj,打开目录(因为它不是文件),使用文本编辑打开所有文件并搜索/替换您想要的内容:-)
Good Luck !
祝你好运 !
回答by Vaayu
You can also change the entire project name by just selecting Project->Rename in recent versions of XCode.
您还可以通过在最新版本的 XCode 中选择 Project->Rename 来更改整个项目名称。
回答by Javal Nanda
Go to Project -> Edit Project Settings -> Select Build tab -> look for productName in packaging category.Change it to what you want.
转到项目 -> 编辑项目设置 -> 选择构建选项卡 -> 在包装类别中查找 productName。将其更改为您想要的。
Same way Change it in Edit Active Target Settings.
同样的方式在编辑活动目标设置中更改它。