Modern Apps git

← xtool.git

pack: stamp DTXcodeBuild from version.plist ProductBuildVersion

Commit
e237d76af8f08f272332490adbf85b16d2f83939
Author
Vayun Mathur <[email protected]>
When
2026-11-19 03:19 UTC (17 days ago)
Parents
c506d76
The SDK bundle's Info.plist DTXcodeBuild lags the final Xcode build
number by one (27A9274 vs 27A9275, 17F112 vs 17F113); App Store
Connect rejects it as an unknown Xcode build
(BUILD_XCODE_NOT_ALLOWED_FOR_APP_STORE_SUBMISSION). The
version.plist ProductBuildVersion is what Xcode itself stamps.

Diff

Sources/PackLib/Packer.swift
diff --git a/Sources/PackLib/Packer.swift b/Sources/PackLib/Packer.swiftindex 163966d..7834c55 100644--- a/Sources/PackLib/Packer.swift+++ b/Sources/PackLib/Packer.swift@@ -296,6 +296,16 @@ public struct Packer: Sendable {             xcode = plist["DTXcode"] as? String             xcodeBuild = plist["DTXcodeBuild"] as? String         }+        // The build number Xcode stamps into apps (DTXcodeBuild) is the+        // version.plist ProductBuildVersion (e.g. 27A9275); the Info.plist+        // DTXcodeBuild in the SDK bundle lags it by one and is rejected by+        // App Store Connect as an unknown Xcode build.+        let xcodeVersion = sdk.bundle.appendingPathComponent("Xcode.app/Contents/version.plist")+        if let data = try? Data(contentsOf: xcodeVersion),+           let plist = try? PropertyListSerialization.propertyList(from: data, format: nil) as? [String: Any],+           let productBuild = plist["ProductBuildVersion"] as? String {+            xcodeBuild = productBuild+        }         return DarwinSDKInfo(version: version, sdkBuild: sdkBuild, xcode: xcode, xcodeBuild: xcodeBuild)     }