14

Is it possible to Copy targets from one Xcode project to another, and if so, how?

Thanks!

SimplyKiwi
  • 12,376
  • 22
  • 105
  • 191

2 Answers2

11

You will have to copy/paste or re-add the files to the new target/project in Xcode 8.

Copy Build Settings

The Build Settings panel supports copy/paste of rows, and it'll overwrite the existing values.

  1. In Xcode go to the target you want to copy settings from and open the Build Settings tab
  2. Switch to "Customized" to see only changes and choose "Combined"
  3. Select your top-level , which should be the same name as your Xcode project
  4. Select all and then copy (Command + C) the Build Settings tab
  5. Open the new project/target to the Build Settings tab
  6. Paste the copied settings (Command + V)
  7. Repeat for the specific target properties (static library, executables, etc.)

Copy Build Phases

You won't be able to copy/paste these settings (unless you dig around in the project file in a text editor, but I don't recommend).

  1. Open both projects side by side, and then add each target dependency, source file, linked library, and headers to the new project/target
  2. Re-create new build scripts and copy your scripts (if you have them)
  3. Re-create new copy file phases any build scripts and copy file phases (if you have them)
Paul Solt
  • 8,375
  • 5
  • 41
  • 46
-3

It is nor really as simple as copying and pasting but you can get around it after making some changes.

Create a new target in you project that you want to copy the target to. From the existing project, go to target build phases and copy all the "Compile Sources" files.

Nitin Bhatt
  • 428
  • 5
  • 13