Xcode project with iOS and tvOS targets

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?

1 Like

Hi @bennet,

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.

If you have any questions, just let us know!

1 Like

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 :thinking:

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 :wink:

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! :heart:

1 Like

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

1 Like

Hi @yonas,

You can now use the output alias feature to not to overwrite (to alias/copy) output env vars, without any scripting! Related announcement: Monthly release of Bitrise CLI tools and summary of updates (May, 2017) - CLI v1.6.1

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! :slight_smile:

Of course if you have any questions in the meantime just let us know! :wink:



I have watchos to be built with bitrise and fastlane not while creating build through bitrise it fails as provisioning profile is not generated.

Hi @arpit_desai, Please contact us on our on-site chat or create separate issue thread detailing the difficulty you’re facing!