复制 Xcode 4 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6428247/
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
Duplicating an Xcode 4 Project
提问by Randall
Basically I want to make an independent copy of my Xcode project and all of my files. How can I do this? I'm researching graphing frameworks and I want to use the same UI for each.
基本上我想制作我的 Xcode 项目和我所有文件的独立副本。我怎样才能做到这一点?我正在研究图形框架,我想为每个框架使用相同的 UI。
回答by Chris Schiffhauer
Seconding @zoul's comment, this can be accomplished in Xcode 4.5 with four steps.
借调@zoul的评论,这可以在Xcode 4.5,四个步骤来完成。
- In Finder, duplicate the project folder. Do not update the
.xcodeproj
file name. - In Xcode, rename the project. Accept the proposed changes.
- Still in Xcode, rename the scheme in "Manage Schemes".
- In
Info.plist
, rename your Bundle identifier.
- 在 Finder 中,复制项目文件夹。不要更新
.xcodeproj
文件名。 - 在 Xcode 中,重命名项目。接受建议的更改。
- 仍然在 Xcode 中,在“管理方案”中重命名方案。
- 在 中
Info.plist
,重命名您的 Bundle 标识符。
回答by nnahum
Few months ago, I had the need to create a different applications with the same source code. I didn't wanted to copy the full directory, so I came up with a procedure that allowed me to mantain the source code in one place and create many different apps based on the same source code.
几个月前,我需要使用相同的源代码创建不同的应用程序。我不想复制完整的目录,所以我想出了一个程序,让我可以在一个地方维护源代码,并基于相同的源代码创建许多不同的应用程序。
My procedure is the following:
我的程序如下:
- duplicate the target to make a new target and change the name to the new name
- change the name of the product and info.plist in the build options (select the new target and click info button), make sure this is for All Configurations
- rename the info.plist file created at the duplication to "newnameInfo".plist (click on the file and then info button and pick the target)
- add icon.png to the resources for the specific target.
- change the name of the icon
- in the NewnameInfo.plist change the icon name to icon_xxx and the bundle identifier com.yourdomain.newname
- in language/other flags you can have a flag to check at the code.
- create a new APP_ID in the iOS Provisional Portal
- if APN is used, configure the APN BEFORE creating the development profile
- create a new development & distribution (ad-hoc or appstore)
- in Target (info) choose the right profile for the code sign
- 复制目标以创建新目标并将名称更改为新名称
- 在构建选项中更改产品和 info.plist 的名称(选择新目标并单击信息按钮),确保这是用于所有配置
- 将复制时创建的 info.plist 文件重命名为“newnameInfo”.plist(点击文件,然后点击 info 按钮并选择目标)
- 将 icon.png 添加到特定目标的资源中。
- 更改图标的名称
- 在 NewnameInfo.plist 中,将图标名称更改为 icon_xxx 并将包标识符 com.yourdomain.newname
- 在语言/其他标志中,您可以有一个标志来检查代码。
- 在 iOS 临时门户中创建一个新的 APP_ID
- 如果使用 APN,请在创建开发配置文件之前配置 APN
- 创建新的开发和分发(ad-hoc 或 appstore)
- 在 Target (info) 中为代码符号选择正确的配置文件
I hope this helps.
我希望这有帮助。
--nnahum
--nnahum
回答by Simon Goldeen
Go to your project folder. Right click on it. Select "duplicate".
转到您的项目文件夹。右键单击它。选择“复制”。
Is there something you want to achieve that this doesn't accomplish?
是否有您想要实现但无法实现的目标?
回答by AJ112
Copy and paste your project folder. Open the new folder and open the Xcode project file. Select the project name in the "Project Navigator" on the left side and then in "File Inspector" on the right hand side, change the name of the project under Identity and Type.
复制并粘贴您的项目文件夹。打开新文件夹并打开 Xcode 项目文件。在左侧的“Project Navigator”中选择项目名称,然后在右侧的“File Inspector”中,在 Identity and Type 下更改项目名称。
That way you will have a duplicate project with two different names.
这样,您将拥有一个具有两个不同名称的重复项目。
Hope this helps!
希望这可以帮助!