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)"