简体   繁体   English

将单个xcode文件用于多个项目

[英]Using a single xcode file for multiple projects

I haven't tried this before but wanted to know how it happens. 我以前没有尝试过,但是想知道它是如何发生的。 Suppose I have an Xcode file for my project called 'Project A'. 假设我的项目有一个名为“ Project A”的Xcode文件。 Now I want to make another project with the same features as that of 'Project A' for a project called 'project B'. 现在,我要为另一个名为“项目B”的项目制作一个具有与“项目A”相同功能的项目。 But for 'project B', I don't want to make a different Xcode file but rather want to incorporate the changes in 'project A' itself so that when I run the same project, I'll be able to run project A or project B as per my need. 但是对于“项目B”,我不想创建另一个Xcode文件,而是希望将更改合并到“项目A”本身中,这样当我运行同一项目时,我将能够运行项目A或B项目,根据我的需要。 How can I achieve this…? 我该如何实现……?

Click on your project, Goto General > Targets. 单击项目,转到“常规”>“目标”。

Right click on your project Target and select Duplicate. 右键单击项目目标,然后选择复制。

You will get to choose between iPad and continue to duplicate for iPhone. 您可以在iPad之间进行选择,并继续为iPhone复制。

Going ahead in each new/existing file, you can choose which target it belongs to and keep doing your development. 在每个新文件/现有文件中,您都可以选择文件所属的目标并继续进行开发。 If you exclude the file from an target, it will not contribute to that app's size. 如果您从目标中排除文件,则文件不会增加该应用的大小。

You can also keep your future files in both Targets depending on your needs. 您还可以根据需要将将来的文件保留在两个Target中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM