In our project we derive our release version from git tag etc then write it to the built folder\'s Info.plist with a shell script like:
GIT_RELEASE_VERSION=$(some
(Xcode 11.2)
Process .../Info.plist
step:Product > Scheme > Edit Scheme... > Build > Post-actions
If you're going to reference any build system environment variables (e.g. BUILT_PRODUCTS_DIR
or INFOPLIST_PATH
), make sure you change the Provide build settings from selection.
Add your shell script, but remember that if you edit any file in the app bundle (i.e. Info.plist
), you'll need to re-sign the app. Add this to your post build step:
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
/usr/bin/codesign --force --sign - --entitlements "${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent" --timestamp=none "${CODESIGNING_FOLDER_PATH}"