I want to set the CFBundleShortVersionString
and CFBundleVersion
of my app clip target dynamically. It should match that of the parent/main app. I tried two solutions:
- I added Run script to the app clip target in Build Settings as follows:
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $GL_BUILD_NAME" "$INFOPLIST"
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $GL_BUILD_NUMBER" "$INFOPLIST"
But this doesn't set the CFBundleShortVersionString
and CFBundleVersion
of the app clip target. I still get build number mismatch error while archiving.
- I also added User-Defined variables (
APP_VERSION
andAPP_BUILD
) in Project Build setting and set the Current Project Version and Marketing Version in Build settings of the project. The main target and app clip then read these values and app archives fine. The problem is that I cannot setAPP_VERSION
andAPP_BUILD
to be reading from an environment variable.
Any help would be appreciated.