iOS version 的自增

version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PRODUCT_SETTINGS_PATH`

version=`expr $version + 1`

/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH

#/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" $PRODUCT_SETTINGS_PATH

buildNumber=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")

shortVersion=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${PROJECT_DIR}/${INFOPLIST_FILE}")

buildNumber=`expr $buildNumber + 1`

/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"

if [ "${CONFIGURATION}" = "Release" ]; then

shortVersion=`expr $shortVersion + 1`

/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $shortVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}"

fi

你可能感兴趣的:(iOS version 的自增)