如何在 Xcode 中只更改应用程序名称?

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

How to change just app name in Xcode?

xcodeswift

提问by Kira

I named my project some-name and this is bad because it is ugly. When somebody installs the app I want app name to be Some Name. How can I do it? I tried to rename it in section Identity and Type and it broke my project very bad.

我将我的项目命名为 some-name,这很糟糕,因为它很丑。当有人安装该应用程序时,我希望应用程序名称为 Some Name。我该怎么做?我试图在 Identity 和 Type 部分重命名它,但它非常糟糕地破坏了我的项目。

I just want to say this is not duplicate. There is no answer to my question. I use cocoapods so that complicates things a bit. I didn't manage to update my app name following provided tutorial.

我只想说这不是重复的。我的问题没有答案。我使用 cocoapods,所以事情有点复杂。我没有按照提供的教程更新我的应用程序名称。

回答by Meagan S.

You never should rename a project in Xcode without doing all the appropriate steps. Sadly, Xcode doesn't make it easy. Below is a great guide taken from here: How do I completely rename an Xcode project (i.e. inclusive of folders)?

你永远不应该在没有执行所有适当步骤的情况下在 Xcode 中重命名项目。遗憾的是,Xcode 并不容易。下面是从这里获取的一个很好的指南:如何完全重命名 Xcode 项目(即包括文件夹)?

This is a four step change. And is a real pain, but it works….

这是一个四步变化。这是一个真正的痛苦,但它的工作......

Step 1 - Rename the project.

步骤 1 - 重命名项目。

1) Click on the project you want to rename in the “project navigator” on the left of the Xcode view. 2) On the right select the “file inspector” and the name of your project should be in there under “Identity and Type”, change it to the new name. 3) A drop down appears, with a “rename” ok box 4) Click rename.

1) 在 Xcode 视图左侧的“项目导航器”中单击要重命名的项目。2)在右侧选择“文件检查器”,您的项目名称应在“身份和类型”下,将其更改为新名称。3) 出现一个下拉菜单,带有“重命名”确定框 4) 单击重命名。

Step 2 - Rename the Scheme

第 2 步 - 重命名方案

1) In the top bar, just by the “Stop” button, is the scheme for your OLD product, click this then “manage schemes” 2) Click on the OLD name in the scheme, and it will become editable, change the name. If you click it twice, you go into the editor (which you don't want) click the manage schemes button to get back again.

1) 在顶部栏中,就在“停止”按钮旁边,是您的 OLD 产品的方案,单击它然后“管理方案” 2) 单击方案中的 OLD 名称,它将变为可编辑,更改名称. 如果您单击它两次,您将进入编辑器(您不需要)单击管理方案按钮再次返回。

Step 3 - Rename the folder with your assets

第 3 步 - 使用您的资产重命名文件夹

1) Quit out of Xcode 2) In the correctly names master folder, there is your newly named xcodeproj file with the the wrongly named OLD folder. Rename the OLD folder to your new name 3) Reopen the project and you get a warning “The folder OLD does not exist”, dismiss the warning 4) On the left in the “project navigator” click the top level OLD folder name. 5) On the right in the “file navigator” under “Identity and type” you will see the “Name” entry change this from the OLD to the new name 6) Just under this is the “location” entry, just below that is a folder symbol with the OLD name. click this and chose the newly renamed folder

1) 退出 Xcode 2) 在正确命名的主文件夹中,有您新命名的 xcodeproj 文件和错误命名的 OLD 文件夹。将 OLD 文件夹重命名为您的新名称 3) 重新打开项目,您会收到警告“文件夹 OLD 不存在”,解除警告 4) 在“项目导航器”的左侧单击顶级 OLD 文件夹名称。5) 在“文件导航器”右侧的“身份和类型”下,您将看到“名称”条目将其从旧名称更改为新名称 6) 在此下方是“位置”条目,就在其下方具有 OLD 名称的文件夹符号。单击此按钮并选择新重命名的文件夹

Step 4 - Rename the Build plist data

第 4 步 - 重命名构建 plist 数据

1) Click on the project in the “project inspector” on the left, in the centre panel select “Build Settings” 2) in this section search for plist 3) Under packaging, you will see Info.plist, and Product bundle identifier. 4) in Info.plist rename the top entry 5) click the Product Identifier and do the same

1) 点击左侧“项目检查器”中的项目,在中间面板中选择“构建设置” 2) 在本节中搜索 plist 3) 在打包下,您将看到 Info.plist 和产品包标识符。4) 在 Info.plist 中重命名顶部条目 5) 单击产品标识符并执行相同操作

FINALLY you are done and can rebuild (Apple-key+shift+k clean, Apple-Key+b then build)

最后,您已完成并可以重建(Apple-key+shift+k clean,Apple-Key+b 然后构建)

回答by Valar Morghulis

  1. click your porject;
  2. open you Utilities panel on the left side;
  3. The first row shows "Identity and Type", and there is "Name" of the project;
  4. change the name there, press Return, then xcode will ask you do you want to change all the target name to this name. Chosse Rename All.
  1. 单击您的项目;
  2. 在左侧打开您的实用程序面板;
  3. 第一行显示“Identity and Type”,还有项目的“Name”;
  4. 在那里更改名称,按 Return,然后 xcode 会询问您是否要将所有目标名称更改为该名称。选择全部重命名。

Done!

完毕!

回答by impression7vx

Well you don't actually have to change the name in XCode because when you will post to the appStore from Apples itunesConnect website, you will be able to place the Name Of The App in there and XCode will just be where the code is accessed!

好吧,您实际上不必更改 XCode 中的名称,因为当您从 Apples itunesConnect 网站发布到 appStore 时,您将能够将应用程序名称放在那里,而 XCode 将只是访问代码的位置!