The version and build number (or version and short version) of a Watchkit app and extension have to be set to the same value as the containing app.
I use environment variables to set the apps version in the Info.plist
dynamically at build time. That also works fine for the Watchkit extension, but not for the Watchkit app.
The environment variables I use have to be provided in the plist for the main app and extension without ${}
(for variable ${VERSION}
I set VERSION
).
if I do the same for the Watchkit app, it is taking the string itself, not the value. If I provide it with dollar & brackets there is no data in the variable.
Any idea how to set the variables for the Watchkit app?
I use this to update all the targets:
#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$SRCROOT/Great WatchKit App/Info.plist"