How to copy and paste files in Compile Sources from one target to another?

后端 未结 3 1116
名媛妹妹
名媛妹妹 2021-01-01 18:58

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

相关标签:
3条回答
  • 2021-01-01 19:29

    You can edit the PBXSourcesBuildPhase section in your ".pbxproj" file. You cand find the file by looking into your ".xcodeproj" file ( right click the project file + show package contents ). After you find the file look for "PBXSourcesBuildPhase". After you find the collection you can just copy/paste source files from one target to the others.

    0 讨论(0)
  • 2021-01-01 19:34

    You can create a duplicate of the target by right-clicking the target and selecting Duplicate. Or press Command+D.

    You can then modify the new target's build settings as needed.

    0 讨论(0)
  • 2021-01-01 19:36

    Yes, you can follow these steps:

    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 Update:

    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.

    0 讨论(0)
提交回复
热议问题