前几天我用一个愚蠢的开发代码开始了一个iPhone项目,现在我想改变这个项目的名称,因为它快要完成了。我该怎么做呢?


当前回答

选择左边最上面的一行(包含项目名称、目标数量等)。 选择要重命名的目标。 再次单击目标的名称。 键入新名称。 按回车。

其他回答

如果您需要在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.

为了把所有相关信息集中在一个地方,这里是这个问题的官方答案——这是唯一一个在Xcode 5.1.1上对我有效的答案

只需使用Xcode中的标识和类型面板。

我在重命名我的iOS项目后使用这个脚本。它有助于更改目录名称并使名称保持同步。

http://github.com/ytbryan/rename

注意:您需要手动更改方案的名称。

用哈维尔的方法重命名我的应用程序非常有效。最后我还想补充一点。

在清理和重建后,我仍然得到一个Mach-O链接器错误。为了解决这个问题;选择你的项目(在项目导航中)。在Targets下,选择yourProjectTests(测试目标)→在General选项卡下,将主机应用程序的值更新为新重命名的项目。

关于捆绑包显示名称的注意事项——这是在应用菜单中更改名称的正确方法,但在看到更改实际生效之前,你可能必须重置iOS模拟器中的内容和设置。