After an application or library is released, when bugs need to be corrected, the build environment of that time may be required. Usually, using the latest version of the environment at the time of the correction is not a problem. However, the build environment of that time may be necessary for the following reasons, for example.
- You want to fix only specific bugs with as narrow a scope of impact as possible.
- Cannot use the latest version of Xcode due to system requirements reasons.
- There is a problem with library dependencies.
- Requires an Xcode version that is officially supported by third-party compilers integrated with Xcode.
I try to keep a record of the build environment by putting written documentation of the build environment in the code repository or with the release notes and handouts.
This article explains how to find out if you did not keep records.
What changes with different versions of Xcode
Different major versions of Xcode have different versions of the cross-platform SDKs that come with Xcode. Cross-platform SDKs are SDKs for using frameworks provided by the OS, such as UIKit and AppKit.
Different versions of the cross-platform SDK used at build time may cause the app to behave differently even on the same OS. In my experience in the past, the design and margins of NSTableView
table headers have changed, and when decoded by NSBitmapImageRep
, the vertical bitmap storage was upside down (this was on macOS 10.5 or so). When running on macOS 11, the OS version that could be obtained was sometimes 10.16
when linked with an older SDK and 11.0
with a newer SDK.
The Xcode release notes often mention these, but sometimes they do not.
About the Info.plist file
On Apple Platforms such as macOS and iOS, apps are in application packages with the extension .app
. Also, frameworks are in a bundle format with a .framework
extension.
These bundles contain an Info.plist
file, which is built at development time with the version number and other information. It contains information entered by the developer, but there is also information added by the compiler and linker. Among the information added automatically is information about the build environment.
Information about the build environment
Here is the information about the build environment that will be added to the Info.plist
file. The ones I am anticipating are marked with “?” is added.
Key | Description |
---|---|
BuildMachineOSBuild | OS build number at build time |
DTCompiler | com.apple.compilers.llvm.clang.1_0 |
DTPlatformBuild | Toolchain version of platform SDK? |
DTPlatformName | Platform Name of Platform SDK |
DTPlatformVersion | Target Version of Platform SDK |
DTSDKBuild | Platform SDK build number |
DTSDKName | Name of Platform SDK |
DTXcode | Xcode Version |
DTXcodeBuild | Xcode build number |
macOS Application Example
Here is an example of a macOS app I built. The following was written to Info.plist
.
キー | 説明 |
---|---|
BuildMachineOSBuild | 21G217 |
DTCompiler | com.apple.compilers.llvm.clang.1_0 |
DTPlatformBuild | 14A400 |
DTPlatformName | macosx |
DTPlatformVersion | 12.3 |
DTSDKBuild | 21E226 |
DTSDKName | macosx12.3 |
DTXcode | 1401 |
DTXcodeBuild | 14A400 |
The environment in which this application was built is macOS 12.6.1 + Xcode 14.0.1.
Wikipedia has a list of OS build numbers, and if you check, 21G217
is listed as macOS 12.6.1
. Also, in DTXcode
, the top two digits are the major version, the third digit is the minor version, and the fourth digit is the revision, so 1401
is 14.0.1
.
iOS App Example
Here is an example of an iOS app I built. The following was written to Info.plist
.
キー | 説明 |
---|---|
BuildMachineOSBuild | 21G217 |
DTCompiler | com.apple.compilers.llvm.clang.1_0 |
DTPlatformBuild | 20A360 |
DTPlatformName | iphonesimulator |
DTPlatformVersion | 16.0 |
DTSDKBuild | 20A360 |
DTSDKName | iphonesimulator16.0 |
DTXcode | 1401 |
DTXcodeBuild | 14A400 |
The environment in which this application was built is macOS 12.6.1 + Xcode 14.0.1.
Wikipedia has a list of OS build numbers, and if you check, 21G217
is listed as macOS 12.6.1
. Also, in DTXcode
, the top two digits are the major version, the third digit is the minor version, and the fourth digit is the revision, so 1401
is 14.0.1
.
Also, as the DTPlatformName
is iphonesimulator
, it is built for the iOS simulator. Also, the DTPlatformVersion
of the SDK is 16.0
, indicating that the iOS 16 SDK is used.