One of our Xcode projects include a target for iOS, and a target for tvOS. Do I need to add each target as a seperate app in Bitrise, or is there a simpler way to manage multiple targets?
For example when the iOS target is updated, I donât want to build (and possibly deploy) the tvOS target.
Any tips on what would be a good way to configure this?
The base Xcode steps work the same way as Xcode.app, so if you e.g. Archive in Xcode.app and that builds both your iOS and tvOS targets, then the step will too.
If you have separate Schemes or Xcode project for the two projects, then you can separate those and use separate Xcode steps where you set the Scheme/Project path for the step directly.
Great, so itâs pretty straightforward in selecting which scheme should be archived in the Archive step.
I am just thinking out loud now, when I say I just need to somehow know whether it should build the iOS scheme, or the tvOS scheme, based on a yet to define selector. This could either be a tag on a commit (like âtvâ or âiosâ), or even separate master/develop branches for each target. Would this be the recommended way? Or Is there some other solution I am missing here
Well, thatâs quite an unusual setup to be honest; the usual way is to have the two separate codes in two separate repos, if you donât want to test, build, publish etc. at the same time.
You definitely can do this, but might require a lot of scripting, as thereâs no built in way to get âwhat changedâ. You can of course get these infos from git, using e.g. a Script step and calling git commands, but then youâll have to define things like âchanged - compared to what?â. For example, should this be compared to the previous commit? To master? To something else?
So, in short, this setup is not a trivial one, but if you have any questions, weâre always happy to help
In our case, both the iOS and tvOS app share a lot of their code, and are each their own target in the same Xcode project.
I donât think adding a complicated git scripting step is the way to go for us, but weâll figure something out that will make it work for our setup!
Thank you for the extremely quick replies! Much appreciated!
@bennet did you arrive at a good solution? We are in the same boat, and are considering creating seperate apps so that the steps remain simple, especially as having multiple of the same steps causes issues as they overrwrite each others outputs (both envs and artifacts)
Weâre also working on First class mono repo support , which can help if you indeed want to register separate apps instead on bitrise.io for the same repo. If youâd prefer that, please vote & comment there so that youâll be notified once the feature is released!
Of course if you have any questions in the meantime just let us know!