Validate Project Settings: Never!

April 3, 2015

Have you ever seen this in Xcode?

Validate Project Settings

If you haven't, then you probably haven't been using Xcode for very long.

Xcode likes to "helpfully" suggest changes to your project's build settings. And this doesn't happen just once. New versions of Xcode come up with even more "helpful" suggestions. So, get used to seeing the warning icon when you open your project. I mean projects. My company's main source repository contains almost 90 Xcode projects. Each of which will show a warning icon when you open it with a new version of Xcode. Nice. Heckuva job, Brownie.

Needless to say, this state of affairs can be very frustrating. It's a problem that's been ongoing for many years now. The worst part is that we don't even want to use Xcode's suggestions. We carefully manage all of our build settings in shared xcconfig files. We don't want Xcode to make any changes at the project level.

But I'm not here just to complain. Although complaining can be fun. I also have a solution to the problem, which will hopefully stop Xcode's annoying behavior forever, or at least until Xcode version 100.

When checking whether a project needs "validating", Xcode actually looks in several places. The main place is in the project file, namely, project.pbxproj. (If you don't know where to find that file, then you're beyond my capacity to help you.) After you finish the "validation" process, Xcode will store its current version number in the project file with the key LastUpgradeCheck. For Xcode 6.2, the value is 0620. Later versions of Xcode will check that value to decide whether your project needs validating. My genius idea, if I may say so myself, thank you, was to manually edit the project file and replace the LastUpgradeCheck value with 9999.

Unfortunately, this was not a complete solution. I discovered that Xcode checks not only the project but also the schemes. So you also have to manually edit the .xcscheme files for your project(s). The relevant key in those files is LastUpgradeVersion, which can also be set to 9999.

In summary, the more I use Xcode, the more I am convinced that the Xcode developers have no idea how their user base uses their app. But that's a story for another blog post. Which I will not write. Because it would consist mostly of unintelligible yelling and swearing. Which is also why I don't file Radars anymore.

Love, Jeff