Xcodeproj
Xcodeproj copied to clipboard
Add method to duplicate existing target
Hi all.
It would be great to have duplicate
method on PBXNativeTarget
.
This would be handy when dealing with automated test, e.g. Calabash for iOS. Test team could pick up latest app from the repo, locate main app target and duplicate it into many other targets, for Calabash, MonkeyTalk, RevealApp or any other test-related stuff the developers shouldn't care about.
For example calabash-ios setup
does this job, but it' snot using Xcodeproj
.
The way I intend to use it is to get the latest app code first, then duplicate main target into a bunch of test-specific targets, then update Podfile to add custom frameworks and pods to newly created targets. And all that with a couple of cli commands, so it can be used on CI server as well.
I can see some valid use cases for this, @mgrebenets if you are interested in this feature, will you submit a patch?
Is there still demand for this?
I am still using calabash-ios setup script. I wouldn't say there's real demand for it. Would be a "nice to have" feature.
Hello, this would be really great. There is a demand to publish many different apps from a single code base.
I am also interested on this. Any work around for now? what operations would need to be performed? maybe create a new target, then go through all properties of original target and assign them in the new one? Not sure if that will reference UDIDs that are target-only...
Without verifying what Xcode actually does, some ideas are:
- Create a new target
- Duplicate the build settings from the previous target a set them
- Duplicate each build phase (including each build file) and add it to the new target
Hi! I am also interested in the duplication of targets. I'm currently looking into doing it manually with xcodeproj but having it do the hard work would be nice and probably safer.
Here's a +1. I also have a use case of multiple targets from the same code base. It's not a huge time savings but would be nice to automate the effects of "command-D" (Duplicate) in Xcode.
For what it's worth, I would love to have this too.
Found this Gist courtesy of @ratazzi, might help people looking for this feature:
https://gist.github.com/ratazzi/f6d9217654d6605450a0
@fabiopelosin Of course, there are demand for this. It is a bothersome and recurrent task. Would save a lot of time for everybody if we have it. On top of that, this task is difficult to do correctly.
Without verifying what Xcode actually does, some ideas are:
* Create a new target * Duplicate the build settings from the previous target a set them * Duplicate each build phase (including each build file) and add it to the new target
Would help a lot.
@chuckSaldana PRs are welcomed :)
Given that this issue is 6 years old, it's not likely to be added unless someone who has a use for it takes the time to contribute the feature