ios Xcode 6 如何重命名复制的目标

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

Xcode 6 how to rename copied target

iosxcodexcode6

提问by Matrosov Alexander

I know that this is not a new question, but I have tried many solution like edit Xcode project file manually or recreating new scheme for target after renaming it.

我知道这不是一个新问题,但是我尝试了许多解决方案,例如手动编辑 Xcode 项目文件或在重命名后为目标重新创建新方案。

Can somebody help me with this question how copy target in right way and then rename it.

有人可以帮助我解决这个问题如何以正确的方式复制目标然后重命名它。

Right now I just rename scheme and it is displayed as is. But when Xcode is running app, under progress indicator it says: Running ProjectName-copy. But I have renamed target but seems product names or some build settings still has "...-copy" in the name.

现在我只是重命名方案,它按原样显示。但是当 Xcode 正在运行应用程序时,在进度指示器下它会显示:Running ProjectName-copy。但是我已经重命名了目标,但似乎产品名称或某些构建设置的名称中仍然带有“...-copy”。

回答by webfrogs

  1. Duplicate a target.
  2. Double click the copy of target and change its name to whatever you want.
  3. 'New target -> Build Settings -> Packaging -> Product Name', change it to the name you want.
  4. Product (Menu item) > Schemes > Manage Schemes, then click the '+' button, select the new target and click 'OK' button.
  1. 复制一个目标。
  2. 双击目标副本并将其名称更改为您想要的任何名称。
  3. 'New target -> Build Settings -> Packaging -> Product Name',改成你想要的名字。
  4. 产品(菜单项)> 方案> 管理方案,然后单击“+”按钮,选择新目标并单击“确定”按钮。

All done.

全部完成。

PS:
After Duplicating the target, Xcode make a new Info.plist file named 'xxx copy-Info.plist' in the root path of project. If you want to change its name and path, after doing this, you should go to 'New target -> Build Settings -> Packaging -> Info.plist file' and change the value to the path of new file.

PS:
复制目标后,Xcode在项目的根路径下新建一个名为'xxx copy-Info.plist'的Info.plist文件。如果你想改变它的名字和路径,这样做之后你应该去'New target -> Build Settings -> Packaging -> Info.plist file'并将值更改为新文件的路径。

回答by Tomasz Dubik

Press on the target name in xcode ( in the same place where you want to select the sim/device type) and select "Manage Schemes...". Highlight the scheme with the copy inside name and press enter on keyboard. You can rename it there.

在 xcode 中按目标名称(在您要选择 SIM/设备类型的同一位置)并选择“管理方案...”。使用内部名称的副本突出显示方案,然后按键盘上的 Enter 键。你可以在那里重命名。

回答by Michael Voznesensky

To copy a target, click on your project, and go to the project inspector tab that looks like this:

要复制目标,请单击您的项目,然后转到如下所示的项目检查器选项卡:

Project: SomeName

项目:SomeName

Targets: SomeName

目标:某个名字

right click on a target, and select duplicate, then double-click slowly on the new target, or select the new target and hit enter, and just put the new name in!

右键单击一个目标,然后选择复制,然后在新目标上缓慢双击,或者选择新目标并按回车键,然后输入新名称即可!

To change running targets, to the top left of your xcode you will see this:

要更改运行目标,您将在 xcode 的左上角看到以下内容:

(start button) (stop Button) (target name and device) [|>] [[]] [/\ TargetName > TargetDevice]

(开始按钮) (停止按钮) (目标名称和设备) [|>] [[]] [/\ TargetName > TargetDevice]

click the target name, next to the little compass (mathematical compass, not navigational) and select your desired target from the dropdown.

单击小罗盘(数学罗盘,非导航)旁边的目标名称,然后从下拉列表中选择所需的目标。

Hope I helped, Matroskin.

希望我有所帮助,Matroskin。