iOS 打包上传 Version 和 Build 的意义
2016-04-12 10:36
381 查看
一个version,一个build,都是设置版本的地方,有什么区别呢?
在iOS中(Android等工程中也一样),有两种version,一种是CFBundleVersion("Bundle Version"),也就是我们看到的version,另一种是CFBundleShortVersionString("Bundle version string, short"),也就是我们看到的Build。
普通情况下,我们只使用version即可,设置为"1.0","1.1", "2.0" ,etc,但如果你要使用两个版本号时候,需要将build设置为1,2,3...等递增的整数,有什么用呢?
version我们可以通过AppStore、itunes或其它软件看到,是给用户看的,而build是我们在团队开发中内部只用
的,只有我们自己可以看到。比如团队打算发布1.0版本的时候,会发布很多build版本供测试或QA团队进行测试,你发布了很多build,因为一直在
修改着代码,因此当你收到一条bug信息时候,你怎么知道是那个build引起的问题呢,这时候build版本号的有点就可以体现出来了
当前运行版本信息可以通过info.plist文件中的bundle version中获取:
NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
CFShow(infoDic);
可以自己输出看一下CFShow打印出来的时什么
下面的代码是如果你想在UI上展示给用户看的获取Version的代码,对比是否升级也是通过version对比,而不是build,也是用下面代码
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey];
在iOS中(Android等工程中也一样),有两种version,一种是CFBundleVersion("Bundle Version"),也就是我们看到的version,另一种是CFBundleShortVersionString("Bundle version string, short"),也就是我们看到的Build。
普通情况下,我们只使用version即可,设置为"1.0","1.1", "2.0" ,etc,但如果你要使用两个版本号时候,需要将build设置为1,2,3...等递增的整数,有什么用呢?
version我们可以通过AppStore、itunes或其它软件看到,是给用户看的,而build是我们在团队开发中内部只用
的,只有我们自己可以看到。比如团队打算发布1.0版本的时候,会发布很多build版本供测试或QA团队进行测试,你发布了很多build,因为一直在
修改着代码,因此当你收到一条bug信息时候,你怎么知道是那个build引起的问题呢,这时候build版本号的有点就可以体现出来了
当前运行版本信息可以通过info.plist文件中的bundle version中获取:
NSDictionary *infoDic = [[NSBundle mainBundle] infoDictionary];
CFShow(infoDic);
可以自己输出看一下CFShow打印出来的时什么
下面的代码是如果你想在UI上展示给用户看的获取Version的代码,对比是否升级也是通过version对比,而不是build,也是用下面代码
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey];
相关文章推荐
- 总是弹出“Building workspace has encountered a problem. Errors during build.”的窗口
- 移动UI设计-表单设计
- 移动UI设计-主要导航模式
- NGUI在5.3打包失败问题
- NGUI在5.3打包失败问题
- unable to dequeue a cell with identifier Identify - must register a nib or a class for the identifie
- 真机测试时报 You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated li
- com.mysql.jdbc.PacketTooBigException: Packet for query is too large (1157 > 1024).
- 《iOS Human Interface Guidelines》——Action Sheet
- wrong requestcode when using startActivityForResult
- EasyUi Datagrid的基础使用
- hdu2817 A sequence of numbers && hdu1420 Prepared for New Acmer(快速幂取模)
- leetcode之Implement Stack Using Queues
- UIFont之preferredFontForTextStyle字体设置之更改
- 2016.04.11,英语,《Vocabulary Builder》Unit 12
- Android BluetoothGatt和周边BluetoothGattServer的实现
- N-Queens -- LeetCode
- request.getParameter() 和request.getAttribute() 区别
- IOS开发之 ---- UIButton on the UIScrollView highlighted delay
- 设置UITableViewCell点击时按钮文字高亮