xcode 如何在 XCode4 中复制项目目标

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

How to duplicate a project target in XCode4

iphonexcodeproject

提问by Fourj

I want to create a target with different bundle id for test environment. I tried using the "Duplicate" function to clone a target and change the bundle id and found that the orignal one was changed too. Thanks for any tips!

我想为测试环境创建一个具有不同包 ID 的目标。我尝试使用“复制”功能来克隆一个目标并更改包 ID,发现原来的也被更改了。感谢您提供任何提示!


================== Update =====================
Solve the link error after duplicates the target, it is a xcode bug. The quote character " is changed to \" in search paths(Building setting of the target).


================== 更新 ======================
解决复制目标后链接错误,它是一个 xcode 错误。搜索路径中的引号字符“更改为\”(目标的构建设置)。

see detail: http://flakasoft.com/developer-tips/xcode-4-bug-duplicating-a-target-results-in-link-error-due-to-missing-paths/

查看详情:http: //flakasoft.com/developer-tips/xcode-4-bug-duplicating-a-target-results-in-link-error-due-to-missing-paths/

回答by RedBlueThing

Double check you have the new duplicate target selected when you modify the Bundle Identifiersetting on the Info Tab. I just tried this and it worked fine.

当您修改信息选项卡上的捆绑标识符设置时,请仔细检查您是否选择了新的重复目标。我刚试过这个,效果很好。

So the bundle identifier is on the info tab, which is actually just a view of the info.pList associated with the target.

所以捆绑标识符位于信息选项卡上,它实际上只是与目标关联的 info.pList 的视图。

To change the info.pList on that target, you will need to make a copy of the pList file (newtarget-info.pList), go into the Build Settingstab for the target, scroll down to the Packagingsegment and modify the Info.pList Filesetting to point to your new file.

要更改该目标上的 info.pList,您需要复制 pList 文件 (newtarget-info.pList),进入目标的Build Settings选项卡,向下滚动到Packaging部分并修改Info。 pList File设置指向您的新文件。

Then when you click on the info tab you will get the settings from your newtarget-info.pList file.

然后,当您单击信息选项卡时,您将从 newtarget-info.pList 文件中获取设置。

回答by Fourj

Figure it out.In XCode4, after duplicate the target, the info.plist file need to be duplicated too. 1. Copy the orignal info.plist file, usually "{APP Name}-Info.plist" 2. Change the setting: "Build Settings"->"Info.plist Files"

搞清楚了。在XCode4中,复制目标后,info.plist文件也需要复制。1. 复制原来的 info.plist 文件,通常是“{APP Name}-Info.plist” 2. 更改设置:“Build Settings”->“Info.plist Files”