大家好,我尝试了以下方式,但它们都没有帮助我在命令行上没有任何错误。
我当前的构建号是1.4.0,我想获得1.5.0 ..
获取捆绑版本并从info.plist文件构建版本值
BUNDLE_VERSION=$(/usr/libexec/PlistBuddy -c "Print:CFBundleShortVersionString" <my plist path>)
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" <my plist path>)
将构建数量增加一个
#BUILD_NUMBER=`echo $BUILD_NUMBER +1|bc` //have tried this one first but didnt work
BUILD_NUMBER=$((BUILD_NUMBER+=1)) //that one also didnt help
有什么想法?
BUILD_NUMBER=$(/usr/libexec/PlistBuddy -c "Print :CFBundleVersion" <my plist path>)
echo $BUILD_NUMBER
将构建数量增加一个
NEWSUBVERSION=`echo $BUILD_NUMBER | awk -F "." '{print $3}'`
NEWSUBVERSION=$(($NEWSUBVERSION + 1))
NEWVERSIONSTRING=`echo $BUILD_NUMBER | awk -F "." '{print $1 "." $2 ".'$NEWSUBVERSION'" }'`
echo $NEWVERSIONSTRING
在主项目中更新信息中的构建号
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${NEWVERSIONSTRING}" <my plist path>