How can I copy build settings from one target to another

1.3k views Asked by At

I'm building a project with many individual test programs in it; each test program is its own target.

There are a number of settings that each target in "Build Settings" such as several preprocessor macros, and about half a dozen libraries in the "Build Phases" tab.

Every time I create a new target, I have to manually enter those values all over again. Or I can duplicate an existing target and edit its build sources.

Neither solution is easy. Is there any way to simply copy the build settings from one target to another?

1

There are 1 answers

0
Swift Dev Journal On

Add a configuration settings file to your project. Choose File > New > File to create a new file. The configuration setting file is in the Other section under iOS or Mac.

Put the build settings you want to copy into the configuration settings file. Select your project from the project editor and click the Info button.

enter image description here

Use the Configurations section to tell Xcode to use your configuration settings file. You can find more detailed information on configuration settings files in the following article:

Xcode Build Configuration Files