Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 5 and shared Schemes

Tags:

git

xcode

xcode5

I'm having an annoying issue with Xcode 5 and the shared schemes.

In my team (we're just two, but hey! it's still a team) we're sharing some Schemes to run the app with different configurations (Debug, QA, Release, ...)

Well now Xcode 5 seems to change the BlueprintIdentifier setting of each scheme based, from what I can understand, on the machine of the developer. And of course the change get's noticed bit git and we either have to checkout them, or commit. Both solution don't make sense...

Any idea on how to fix it? I did a google search but found nothing for Xcode 5...

I don't want to give up on those shared configurations! A solution I can came up with to keep having the shared Schemes tracked is unshared them, copy them in a dedicated test folder, then using a strategy like the one used for the Pods to copy those schemes locally, where Xcode can mess up with them without us noticing. Something like a schemes script that reads a Schemefile file which lists the schemes to copy from the Schemes/ folder, and a Schemefile.lock that is updated every time there's some change and that is read by the Xcode build process in order to make sure everything is up-to-date.

This seems a lot of work for such a tiny thing, so before jumping head down into it I would like to know if anyone has some better solution to propose.

Cheers :)

like image 866
mokagio Avatar asked Sep 26 '13 09:09

mokagio


People also ask

How do I share a scheme in Xcode?

To share a scheme, click on "Manage schemes" in Xcode and make sure that the scheme used for building your xcproject/xcworkspace is marked as shared. The scheme's container needs to be set to the Xcode project or workspace you want to build.

What is difference between target and scheme in Xcode?

A Target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.

Where is manage schemes in Xcode?

To do so, we need to manage the schemes of the project. Open the scheme manager. Select Product -> Scheme -> Manage Schemes… from the toolbar.


2 Answers

First, I'm assuming you're using CocoaPods because you mentioned it in your question.

I've had this issue for a while and just recently discovered that some of my shared schemes are not getting their BlueprintIdentifier changed with the others. Upon investigation, I noticed that the untouched schemes had a Pods target under builds that was missing–as in it was listed in red like this: Pods (missing). My theory is that pod install and various Xcode events (i.e. crashing, launching, etc) were causing the scheme to change its BlueprintIdentifiers because they had a reference to a Pod target in the scheme build settings.

I removed the Pods reference in all of my schemes and have not been able to reproduce the BlueprintIdentifierchange since. My target that depends on Pods has libPods.a specified under Link Binary With Libraries in Build Phases and set to required, so it still gets compiled before the main target.

Note that switching between branches with this change and without this change might still produce modifications to the scheme files.

like image 129
Wes Avatar answered Nov 15 '22 23:11

Wes


@Wes's answer didn't specifically fix this issue for me, but it did lead me to the right place. The solution for me was to turn "Find Implicit Dependencies" from "off" (unchecked) to "on" (checked) from the Edit Scheme screen for the Scheme that keeps changing.

like image 45
michaelavila Avatar answered Nov 16 '22 00:11

michaelavila