如何将编译源中的文件从一个目标复制并粘贴到另一个目标? [英] How to copy and paste files in Compile Sources from one target to another?

查看:36
本文介绍了如何将编译源中的文件从一个目标复制并粘贴到另一个目标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个主要目标,其目标 -> 构建阶段 -> 编译源下包含某些文件.我正在开始一个单元测试,并希望单元测试包含与主要目标相同的文件.有没有办法将一个目标中包含的文件复制并粘贴到另一个目标?

I have a main target that have certain files included under its target -> Build Phases -> Compile Sources. I'm starting a unit test and would like the unit test to include the same files as the main target. Is there a way to copy and paste the files included in one target to another target?

推荐答案

是的,您可以按照以下步骤操作:

Yes, you can follow these steps:

  1. 选择主要目标上的所有编译源.
  2. 右键单击选择并选择在项目导航器中显示(CMD + Shift + j).文件将在左侧窗格中被选中.
  3. 选择另一个目标.
  4. 将选定的文件从 Project Navigator 拖放到另一个目标的 Compile Sources.
  1. Select all Compile Sources on the main target.
  2. Right click on the selection and choose Reveal in Project Navigator (CMD + Shift + j). The files will be selected in the left pane.
  3. Select another target.
  4. Drag and drop the selected files from Project Navigator to Compile Sources of another target.

Xcode 9.2 更新:

在 Xcode 9.2 中,您一次最多只能选择 150 个项目 来使用拖放功能.如果您想复制更多的项目,您可以分批进行.

It looks like in Xcode 9.2 you can select only up to 150 items at once to use Drag and drop. If you want to copy more items you can do it in batches.

这篇关于如何将编译源中的文件从一个目标复制并粘贴到另一个目标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆