如果用户名是XXX,如何在Xcode中自动增加构建版本?

时间:2012-09-25 09:01:20

标签: xcode bash shell

如果用户名是XXX,如何在Xcode中自动增加构建版本?

我试过了:

 #!/bin/bash
    if [$USER == "XXX"];then
    buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
     buildNumber=$(($buildNumber + 1))
    /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
   fi

但没有成功..任何想法?

1 个答案:

答案 0 :(得分:0)

我找到了它:

#!/bin/bash
if [ $ALTERNATE_OWNER == "XXX" ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
fi