如何更改 Xcode 项目名称

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4954015/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:42:04  来源:igfitidea点击:

How to change Xcode Project name

iphonexcodeiphone-sdk-3.0ios4ios-simulator

提问by Haseeb

I have developed my app in Xcode for iPhone, in start I have just named it without secnec now I want to change my app name I have replace my old app name with new one as I have found the name in my app, but its still giving me one error...

我已经在 Xcode 中为 iPhone 开发了我的应用程序,一开始我只是在没有 secnec 的情况下命名它现在我想更改我的应用程序名称我已经用新的应用程序名称替换了我的旧应用程序名称,因为我在我的应用程序中找到了名称,但它仍然给我一个错误...

Desktop/New name/old name_Prefix.pch: No such file or directory

桌面/新名称/旧名称_Prefix.pch:没有那个文件或目录

when I have change oldname_prefix.pch with newname_prefix.pch ..

当我用 newname_prefix.pch 更改 oldname_prefix.pch ..

回答by ohho

For Xcode 4 or later:

对于 Xcode 4 或更高版本:

  • Open a project
  • Select Project Navigator
  • Highlight project name
  • Single click on project name

    enter image description here

  • 打开一个项目
  • 选择项目导航器
  • 突出显示项目名称
  • 单击项目名称

    在此处输入图片说明

For Xcode 3:

对于 Xcode 3:

  • Open a project > Menu > Project > Rename ...
  • 打开一个项目 > 菜单 > 项目 > 重命名...

回答by Bogatyr

There is no need to change the name of the project in order to change the display name of the application (which is what you see on the home screen of the iOS device, in iTunes, etc.). Simply change the "Bundle display name" in your info.plist from the default "${PRODUCT_NAME}" to whatever you want it to be. The name of your project is invisible to users, they only see the "Bundle display name."

无需更改项目名称即可更改应用程序的显示名称(即您在 iOS 设备的主屏幕、iTunes 等中看到的名称)。只需将 info.plist 中的“捆绑显示名称”从默认的“${PRODUCT_NAME}”更改为您想要的任何名称。您的项目名称对用户不可见,他们只能看到“Bundle 显示名称”。

回答by Sabareesh Kkanan

Image explains everything

图片说明一切

click on you project in project explorer and again click on your project on right side and there you can see project name as shown in the figure

在项目资源管理器中点击你的项目,再次点击右侧的项目,你可以看到项目名称,如图

回答by Rajavanya Subramaniyan

  1. On the left side expand Targets
  2. Double click on your target and then select build tab in the newly opened window
  3. on the top right there is a search box. Type - "Product Name"
  4. Now look below, under packaging section, you will see Product Name
  5. Change it and clean rebuild, your new app name should be changed by now.
  1. 在左侧展开目标
  2. 双击您的目标,然后在新打开的窗口中选择构建选项卡
  3. 右上角有一个搜索框。类型 - “产品名称”
  4. 现在看下面,在包装部分下,您将看到产品名称
  5. 更改它并清理重建,您的新应用程序名称现在应该已更改。

回答by Alok

For changing application name only(that will display along with app icon) in xcode 4 or later:

用于在 xcode 4 或更高版本中更改应用程序名称(将与应用程序图标一起显示):

Click on your project file icon from Groups & Files panel, choose Target -> Build Settings -> Packaging -> Product Name. Click on the row, a pop-up will come, type your new app name here.

从 Groups & Files 面板单击您的项目文件图标,选择 Target -> Build Settings -> Packaging -> Product Name。单击该行,将出现一个弹出窗口,在此处输入您的新应用程序名称。

For changing Project name only(that will display along with project icon) in xcode 4 or later:

用于在 xcode 4 或更高版本中更改项目名称(将与项目图标一起显示):

Click on your project file icon from Groups & Files panel, choose Project(above targets) from right pane, just see at the far right pane(it will be visible only if you have enabled "Hide or show utilities").Look for project name.Edit it to new name you want to give your project.

在“组和文件”面板中单击您的项目文件图标,从右侧窗格中选择项目(目标上方),只需在最右侧的窗格中查看(仅当您启用“隐藏或显示实用程序”时才可见)。查找项目名称。将其编辑为您要为项目命名的新名称。

Delete your app from simulator/device, clean and run.Changes should reflect.

从模拟器/设备中删除您的应用程序,清理并运行。更改应反映。

That's it

就是这样

回答by Jason

Goto youname-Info.plist

转到 youname-Info.plist

Change Both

改变两者

Bundle name and Bundle display name to your preferred file name.

捆绑名称和捆绑显示名称为您首选的文件名。

Done.

完毕。

回答by Desmond

ohho's answer is perfect:

ohho的回答是完美的:

For Xcode 4 or later:

Open a project

Select Project Navigator

Highlight project name

Single click on project name

对于 Xcode 4 或更高版本:

打开一个项目

选择项目导航器

突出显示项目名称

单击项目名称

BUT, if you only do this, once you try to debug on a new device, you will find an error:

但是,如果你只这样做,一旦你尝试在新设备上调试,你会发现一个错误:

file not found: /Users/someuser/Library/Developer/Xcode/DerivedData/OLDNAME-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/OLDNAME.app/OLDNAME

clang: error: linker command failed with exit code 1 (use -v to see invocation)

找不到文件:/Users/someuser/Library/Developer/Xcode/DerivedData/OLDNAME-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/OLDNAME.app/OLDNAME

clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Then you need to do one more step:

然后你需要再做一个步骤:

  • Select target on the left panel
  • Choose the oldnameTests in Targets
  • Select the Build Settings Panel
  • Search for "TEST_HOST" and change the old value to the new.
  • 在左侧面板上选择目标
  • 在 Targets 中选择 oldnameTests
  • 选择构建设置面板
  • 搜索“TEST_HOST”并将旧值更改为新值。

Good Luck and Have Fun

祝好运并玩得开心点

回答by NaXir

Here is Apple's step by step visual guideto change name of Xcode project.

这是Apple更改 Xcode 项目名称的分步视觉指南

To change name of workspace just rename it.

要更改工作区的名称,只需重命名即可。

回答by jazzed28

I am using xcode 4.3.1 and tried to change product name as Quakeboy said above in the bundle setting, but it led to reading error. I was stuck in this error for an hour and now it is working well. I simply made the product name blank then retype the older name that I had before. building succeeded again!

我正在使用 xcode 4.3.1 并尝试更改产品名称,如上面在捆绑设置中所说的 Quakeboy,但导致读取错误。我被这个错误困了一个小时,现在它运行良好。我只是将产品名称设为空白,然后重新键入我以前使用的旧名称。再次建设成功!

Note to anyone who like to change project name : you don't have to change the project file name the bundle display name will be display to users so just don't hang out with this issue too much. can be wasting time.

请注意任何喜欢更改项目名称的人:您不必更改项目文件名,捆绑显示名称将显示给用户,因此不要过多地解决此问题。可能会浪费时间。

回答by JeffB6688

in xcode 4.4, you have to click on the project at the top of the navigator (left panel). Then click twice on the target in the second column to highlight the target name. Then you can change the product name. You will also need to modify the archive name when you go to create an archive. To do this, you must edit the scheme, click on Release, and then change the archive name.

在 xcode 4.4 中,您必须单击导航器(左侧面板)顶部的项目。然后在第二列中的目标上单击两次以突出显示目标名称。然后您可以更改产品名称。创建存档时,您还需要修改存档名称。为此,您必须编辑方案,单击发布,然后更改存档名称。