前几天我用一个愚蠢的开发代码开始了一个iPhone项目,现在我想改变这个项目的名称,因为它快要完成了。我该怎么做呢?
当前回答
在新版本的Xcode (Xcode 5也是)中,要更改项目名称,请遵循以下简单(尽可能详细)的步骤:
注意:在这个例子中,我将把一个假设的“样本”名称改为“测试”名称。
Click twice slowly on the project root in the project navigator and then it becomes editable. Rename the project. After pressing Enter the assistant will suggest you to automatically change all project-name-related entries and will allow you to de-select some of them, if you want. Press 'RENAME' and Xcode will do the rest. In the meanwhile Xcode may ask you about the option of making a snapshot of the project (it is very recommendable to do so). In addition to renaming the project, you may want to rename the scheme so that it matches your new project name. Repeat similar steps like 1 and 2, and press OK. That's it.
另一个场景…
前面的解释与更改项目名称有关,但您可能只需要更改主屏幕应用程序图标下方的显示名称。以下是步骤:
在“支持文件”组中找到信息。Plist(或相关)文件 找到“Bundle display name”键并将值更改为新名称。 从模拟器或任何其他测试设备中删除“旧”应用程序。 再次清理并重新构建应用程序。 就是这样。现在你将在主屏幕上看到新的应用程序名称。
其他回答
在Xcode 4或更高版本中,仅更改应用程序名称(将与应用程序图标一起显示):
在“组和文件”面板中单击项目文件图标,选择“目标”→“生成设置”→“包装”→“产品名称”。单击该行。快闪店会来的。在这里输入您的新应用程序名称。
在Xcode 4或更高版本中,仅更改项目名称(将与项目图标一起显示):
在Groups & Files面板中点击你的项目文件图标,从右边面板中选择project(在目标上面)。看看最右边的窗格(只有启用了“隐藏或显示实用程序”,它才可见)。查找项目名称。将其编辑为您想要赋予项目的新名称。
从模拟器/设备中删除应用程序,清理并运行。变化应该反映。
就是这样。
这是我在Xcode 4中改变它的方式:
单击目标文件(应用程序的第一个主文件)。 进入构建设置。 向下滚动,你会发现一个名为“包装”的栏。 在“包装”下,您将看到“产品名称”,您可以更改项目名称。
我认为这里有一点混乱:
您想更改项目名称还是 你想在iOS仪表板上更改应用程序名称吗?
通常改变后者就足够了,在plist中添加/修改BUNDLE DISPLAY NAME键。
最好保持项目名称不变,但它可能会被更改。
注意,Bundle显示名称可以包含空格和特殊字符,但项目不能。这样做一些cmd行工具将失败,由于文件名路径规则。
甚至可以本地化更多的Bundle Display名称。
因此,除非您处于早期阶段,需要更改内部项目名称,否则请继续使用Bundle Display name键。
如果您需要在iPhone主屏幕上更改应用程序的名称,则需要在Target配置中进行,而不是在项目配置中进行。
Expand the Targets group in Xcode, and 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, and then navigate to the Build tag. Set the Configuration drop-down to read All Configurations. 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: Voilà! Do a clean and a build. Your application will take on the new name.
有
产品名称($(PRODUCT_NAME)):默认为目标名称。这有助于方案选择正确的目标 Bundle显示名称(CFBundleDisplayName):默认为Product name。这就是显示给iOS用户的内容
推荐文章
- iPhone上UIView和UILabels的渐变
- keychain上的分发证书中缺少私钥
- 在实现API时,我如何避免在块中捕获自我?
- Xcode的构建文件夹在哪里?
- 如何创建一个Swift Date对象?
- Xcode 4在目标设备上说“finished running <my app>”——什么都没有发生
- 从另一个应用程序打开设置应用程序
- 快速提取正则表达式匹配
- 如何应用梯度的背景视图的iOS Swift应用程序
- 图书馆吗?静态的?动态吗?或框架?另一个项目中的项目
- 如何用SwiftUI调整图像大小?
- Xcode 6 gitignore文件应该包括什么?
- 如何在iPhone/iOS上删除电话号码的蓝色样式?
- 检测视网膜显示
- 如何在UIImageView中动画图像的变化?