0

I work on an xcode project with multiple people. Every time someone switches between running on device and simulator, this adds a change in xcshareddata/scschemes/{schemename} to the next commit.

It is extremely annoying to have each commit stuffed with those scheme changes. Whilst it is convenient to be able to continue with the scheme that you have just been working on when cloning the repo, a fresh clone is not something you perform numerous times a day so I would much prefer the following situation:

Have a "static" set of schemes in the repo so whenever someone clones the repository they will start out with an {App Name} -> "Any iOS Device" scheme. Once they change this to their personal iPhone or Simulator, Xcode's versioning should ignore that file so it doesn't clutter up commits.

What's a bit annoying about this setup is that you have to select your target device after each clone but again I would rather how to set the target device every once in a while than read through the "changes" in commits and pull requests where 80% of the additions and deletions consist of someone iterating through simulators.

How would I got about setting up our repository/ git/ .gitignore to achieve this state?

user2161301
  • 674
  • 9
  • 22
  • 1
    "Every time someone switches between running on device and simulator, this adds a change in xcshareddata/scschemes/{schemename} to the next commit." No, it doesn't. A destination is not a scheme, and changing a destination does not affect any schemes. In fact, they have nothing to do with each other; both scheme and destination are shown at the top of the Xcode project window, but that is just for convenience. So first things first: I don't deny that your shared schemes might be changing, and that that can be annoying, but first you need to figure out correctly why that is. – matt Nov 29 '20 at 19:41
  • 1
    And even if your shared scheme is changing, for whatever reason, you can always make a personal nonshared scheme from it, instead, and use that. For example, the scheme would change if you turned on and off an environment variable or launch argument, or changed the simulated location, or whatever. But you should not be doing that with a _shared_ scheme. And in a standard gitignore configuration, nonshared schemes are not added, committed, or pushed. – matt Nov 29 '20 at 19:43
  • I appears to be a common problem as https://stackoverflow.com/questions/6770472/what-do-all-the-changes-to-xuserstate-and-xcscheme-files-represent and a few other people had a similar questions to the constantly-changing schemes. You are however right about this being a problem with my project - I tried with another project that does not reflect that behavior. I don't have build scripts, pods or anything going on that would cause the schemes to rearrange themselves all the time. I will continue to investigate, thank you for your response Matt – user2161301 Nov 29 '20 at 20:08

0 Answers0