Targeting older macOS SDKs with Xcode 12

We have a macOS app that supports macOS 10.12 and later.
We're using a 2018 Mac mini running macOS 10.15.7 for the release builds with Jenkins.

In the last years and with older versions of Xcode we have always installed older macOS SDKs (using publicly available scripts) and used them to build against as we have run into several issues when building against the latest SDK version and only setting the deployment target to an older version (which we still do of course).

With the latest version of Xcode this doesn't seem to be possible anymore so we thought we'd just do it the "official" way then: targeting the most recent macOS SDK and only setting the deployment target.

When a user reported a bug with a release build now we sent him a debug build which was built on macOS 10.14.6 and Xcode 11 (also targeting the 10.14 SDK) and the issue is gone. No code changes whatsoever. When he switches back to the official release version the issue returns immediately.

So I have to assume it has something to do with the version of macOS that is used to build against.

What's the best way to go about this and how to go forward from here?

Thanks and best regards,

Flo
The best way forward is to use the macOS 11 SDK with Xcode 12 to build the app, and then work towards addressing the bugs you're seeing.

When building with a new version of Xcode, and running on the latest version of macOS, you're changing several things:
  • Build time: New SDK version, with API additions and deprecations

  • Build time: New compiler versions

  • Runtime: implementation changes in the system frameworks

  • Runtime: No longer using code paths in system frameworks gated by linked-on-or-after checks that are used to maintain API compatibility for apps linked using older macOS SDK versions

Each of these can then expose latent bugs in your code that weren't visible previously, and there isn't a single reason for this or single thing you can do to address them all at once. You will need to understand each issue revealed by building with the new tools and new SDK, debug that issue specifically, and make the changes required to resolve the issue.
Targeting older macOS SDKs with Xcode 12
 
 
Q