From a2adfaeae0aa03f50f971d7f4dbd5a2f7f2bda09 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 23:21:54 +0000 Subject: [PATCH] Give the Apple Watch app the phone app's version and build number TestFlight refused the first build with the watch app inside: its Info.plist had a fixed CFBundleVersion of 1, and App Store Connect wants a watch app's to be its phone app's (error 90379). It now takes MARKETING_VERSION and CURRENT_PROJECT_VERSION, as the app and the widget do, which scripts/archive.sh sets for each build. The archive's check now also compares the versions of the bundles inside the app, so a mismatch fails there rather than on upload. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R2bAq5cvLWgAnGu2dW6vr4 --- WatchApp/Info.plist | 4 ++-- project.yml | 3 +++ scripts/archive.sh | 14 +++++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/WatchApp/Info.plist b/WatchApp/Info.plist index 9d70785..2fe10ad 100644 --- a/WatchApp/Info.plist +++ b/WatchApp/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(MARKETING_VERSION) CFBundleVersion - 1 + $(CURRENT_PROJECT_VERSION) WKApplication WKCompanionAppBundleIdentifier diff --git a/project.yml b/project.yml index 2e6c32c..1559ab1 100644 --- a/project.yml +++ b/project.yml @@ -150,6 +150,9 @@ targets: path: WatchApp/Info.plist properties: CFBundleDisplayName: Clementine Remote + # The App Store refuses a watch app whose versions aren't the phone app's. + CFBundleShortVersionString: $(MARKETING_VERSION) + CFBundleVersion: $(CURRENT_PROJECT_VERSION) WKApplication: true WKCompanionAppBundleIdentifier: $(APP_BUNDLE_ID) settings: diff --git a/scripts/archive.sh b/scripts/archive.sh index de5ef4b..1262808 100755 --- a/scripts/archive.sh +++ b/scripts/archive.sh @@ -96,7 +96,8 @@ mv "$out/export/"*.ipa "$out/ClementineRemote.ipa" rm -rf "$out/export" # What App Store Connect checks on upload, so that a bundle it would refuse fails here: every -# framework is a dynamic library, and everything in the .ipa is signed. +# framework is a dynamic library, the bundles inside the app have its version and build number, +# and everything in the .ipa is signed. check="$out/ipa-check" rm -rf "$check" unzip -q "$out/ClementineRemote.ipa" -d "$check" @@ -108,6 +109,17 @@ for framework in "$check/Payload/"*.app/Frameworks/*.framework; do exit 1 fi done +for bundle in "$check/Payload/"*.app/PlugIns/*.appex "$check/Payload/"*.app/Watch/*.app; do + [ -e "$bundle" ] || continue + for key in CFBundleShortVersionString CFBundleVersion; do + value=$(/usr/libexec/PlistBuddy -c "Print :$key" "$bundle/Info.plist") + expected=$([ "$key" = CFBundleVersion ] && echo "$build" || echo "$version") + if [ "$value" != "$expected" ]; then + echo "$(basename "$bundle")'s $key is $value, not the app's $expected" >&2 + exit 1 + fi + done +done codesign --verify --deep --strict --verbose=2 "$check/Payload/"*.app rm -rf "$check" echo "Built $out/ClementineRemote.ipa: $version ($build)"