how to setting XCode project that have two target with same bundle version

392 Views Asked by At

so if i upload on appstoreconnect and have different bundle version on each target it will be ignored by apple. ignored info when uploading to appstoreconnect

PLIST="${PROJECT_DIR}/${INFOPLIST_FILE}"
PLB=/usr/libexec/PlistBuddy
LAST_BUILD_VERSION=$($PLB -c "Print CFBundleVersion" "$PLIST")
IFS=. components=($LAST_BUILD_VERSION)
major=${components[0]}
minor=${components[1]}
micro=${components[2]}
build=${components[3]}
build_plus=$((build + 1))
old_build="$major.$minor.$micro.$build"
new_build="$major.$minor.$micro.$build_plus"
$PLB -c "Set :CFBundleVersion $MARKETING_VERSION.$build_plus" "$PLIST"

i already made a run-script that change the last number for one target but i dont have idea to change another target using run script

if it 5.5.10.1 then it would change it to 5.5.10.2 for main target. but the other target dont get change

1

There are 1 best solutions below

5
congnd On

enter image description hereI think you can use User-Defined Setting at the project level, then use that value for all of your targets.