如何自动递增X code 5的内部版本号 [英] How to auto increment the build number in Xcode 5

查看:235
本文介绍了如何自动递增X code 5的内部版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如果X code 5提供设定,自动计数在Project Navigator的标识部分一般下找到的内部版本号疑惑。

I was wondering if Xcode 5 is providing a setting to automatically count up the Build number found under General in the Identity section of the project navigator.

但据我所知,你仍然有脚本来做到这一点,使用PlistBuddy。

But afaik you still have to do it with scripting, using PlistBuddy.

一个简单的解决方案是增加X code 5的版本号公布如下:

One simple solution is to increase the build number in Xcode 5 is posted below:

推荐答案

转到编辑 - >添加构建阶段 - >添加运行脚本生成阶段

Go to Editor -> Add Build Phase -> Add Run Script Build Phase

转到构建阶段在Project Navigator和编辑运行Sript。
更改壳牌为/ bin / bash和粘贴下面的脚本:

Go to Build Phases in the project navigator and edit Run Sript. Change Shell to /bin/bash and paste the following script:

#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"

不要忘了改常规下找到了标识部分从1.0到1的内部版本号

Don't forget to change the Build number found under General in the Identity section from 1.0 to 1

玩得开心! :)

我发现这个教程可可厂

这篇关于如何自动递增X code 5的内部版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆