Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method to duplicate existing target #75

Open
mgrebenets opened this issue Jun 10, 2013 · 13 comments
Open

Add method to duplicate existing target #75

mgrebenets opened this issue Jun 10, 2013 · 13 comments

Comments

@mgrebenets
Copy link

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.

@fabiopelosin
Copy link
Member

I can see some valid use cases for this, @mgrebenets if you are interested in this feature, will you submit a patch?

@fabiopelosin fabiopelosin changed the title [Feature Request] Method to duplicate existing target Add method to duplicate existing target Mar 27, 2014
@fabiopelosin
Copy link
Member

Is there still demand for this?

@mgrebenets
Copy link
Author

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.

@DmitryPR
Copy link

Hello, this would be really great.
There is a demand to publish many different apps from a single code base.

@angelolloqui
Copy link

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...

@fabiopelosin
Copy link
Member

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

@carlosefonseca
Copy link

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.

@owurman
Copy link

owurman commented Feb 24, 2016

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.

@vittoriom
Copy link

For what it's worth, I would love to have this too.

@eggsy84
Copy link

eggsy84 commented Mar 27, 2017

Found this Gist courtesy of @ratazzi, might help people looking for this feature:

https://gist.github.com/ratazzi/f6d9217654d6605450a0

@neofly
Copy link

neofly commented Jan 24, 2018

@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.

@chuckSaldana
Copy link

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.

@amorde
Copy link
Member

amorde commented May 10, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests