Make a new Xcode target that's a copy of an existing one

Dear Experts,

Is there a way to create a new target in Xcode that is a copy of an existing target?

Specifically, I have a standard iOS app target in the project. I'd like to build a second iOS app by adding a second target to the same project. I'd like it to start as a copy of the first target, and then I'll add and remove source files and frameworks, change assets and settings etc.

It seems to me that I have to create a new target and then add all the source files etc to it, and then replicate all the settings. I've tried to do this, but it isn't working - bizarrely I just see a black screen, though log messages suggest that the app is running. I am unsure about whether the two targets are sharing e.g. the Info.plist file, etc.

Any advice? Thanks.

Answered by ssmith_c in 757688022

click on the project in the navigator on the right, to expose the list of targets in the editor. Right click on the target you want to duplicate, and select "Duplicate".

Accepted Answer

click on the project in the navigator on the right, to expose the list of targets in the editor. Right click on the target you want to duplicate, and select "Duplicate".

Ah ha! Thanks, @ssmith_c . So obvious.

Make a new Xcode target that's a copy of an existing one
 
 
Q