Check the built environment from the “Info.plist” file

Once an application or library has been released, there may be times when you need to reproduce the original build environment to fix bugs. Usually, using the latest version of the environment at the time of the correction is fine. However, there may be various reasons why it’s necessary to reproduce the original build environment. For instance:

  • 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 maintain a record of the built environment by incorporating its documentation into the code repository or including it with the release notes and handouts.

This article explains how to determine if you still need to keep records.

目次

What changes with different versions of Xcode

Each major version of Xcode comes with a distinct version of cross-platform SDKs. 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. For example, in my experience in the past, the design and margins of the NSTableView table headers have changed. 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.

While these changes are frequently mentioned in the Xcode release notes, they may sometimes be omitted.

About the “Info.plist” file

On Apple platforms, like macOS and iOS, apps reside in application packages denoted by the .app extension. Also, frameworks are in a bundle format with a .framework extension.

These bundles contain the Info.plist file, built at development time with the version number and other information. It contains information the developer enters, but the compiler and linker also add information. Among the information added automatically is information about the built environment.

Information about the built environment

The following table details the build environment information added to the Info.plist file. The entries I predict may be added are marked with a “?”.

KeyDescription
BuildMachineOSBuildOS build number at build time
DTCompilercom.apple.compilers.llvm.clang.1_0
DTPlatformBuildToolchain version of platform SDK?
DTPlatformNamePlatform Name of Platform SDK
DTPlatformVersionTarget Version of Platform SDK
DTSDKBuildPlatform SDK build number
DTSDKNameName of Platform SDK
DTXcodeXcode Version
DTXcodeBuildXcode build number
Information about the build environment

macOS Application Example

Below is an example from a macOS app I developed. The following was written to the Info.plist file.

KeyDescription
BuildMachineOSBuild21G217
DTCompilercom.apple.compilers.llvm.clang.1_0
DTPlatformBuild14A400
DTPlatformNamemacosx
DTPlatformVersion12.3
DTSDKBuild21E226
DTSDKNamemacosx12.3
DTXcode1401
DTXcodeBuild14A400
Example of macOS application

The application was developed in an environment utilizing macOS 12.6.1 and 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 the Info.plist file.

KeyDescription
BuildMachineOSBuild21G217
DTCompilercom.apple.compilers.llvm.clang.1_0
DTPlatformBuild20A360
DTPlatformNameiphonesimulator
DTPlatformVersion16.0
DTSDKBuild20A360
DTSDKNameiphonesimulator16.0
DTXcode1401
DTXcodeBuild14A400
iOS App Example

The environment in which this application was built is macOS 12.6.1 + Xcode 14.0.1.

Wikipedia lists OS build numbers; 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 the 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.

著書紹介

Authored Books

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

Akira Hayashi (林 晃)のアバター Akira Hayashi (林 晃) Representative(代表), Software Engineer(ソフトウェアエンジニア)

アールケー開発代表。Appleプラットフォーム向けの開発を専門としているソフトウェアエンジニア。ソフトウェアの受託開発、技術書執筆、技術指導・セミナー講師。note, Medium, LinkedIn
-
Representative of RK Kaihatsu. Software Engineer Specializing in Development for the Apple Platform. Specializing in contract software development, technical writing, and serving as a tech workshop lecturer. note, Medium, LinkedIn

目次