iOS 应用版本信息 BundleVersion

苹果开发者文档介绍到

KeyXcode nameSummary
CFBundleShortVersionString“Bundle versions string, short”(Localizable) The release-version-number string for the bundle.
CFBundleVersion“Bundle version”(Recommended) The build-version-number string for the bundle.

CFBundleShortVersionString 为发布版本号,标识应用程序发布的正式版本号。
CFBundleVersion 为构建版本号,标识应用程序构建(发布或未发布)的内部版本号。

版本号通常由三个整数,句点分隔组成。例如:1.2.3

版本号的命名规则(一般情况):

  1. 第一位数字,也称主版本号,表示重要功能或重大更新。
  2. 第二位数字,次要功能更新。
  3. 第三位数字,表示正常维护更新。

AppStore 发布使用的是 CFBundleShortVersionString 短版本号。开发者上传应用进行审核,如若未通过则需修复问题,再次打包发布,此时 CFBundleShortVersionString 可以保持不变,但是 CFBundleVersion 需要不断增加。CFBundleVersion 一般不对外公开,在团队内部使用。

实际使用场景分析:

我的应用首次上传 AppStore 发布版本号为 1.2.3 (CFBundleShortVersionString),构建版本号为 1.0.1 (CFBundleVersion)。应用商店审核未通过,修复问题之后再次打包上传 AppStore,发布版本号不变仍为 1.2.3,但是构建版本号一定递增 1.0.21.0.3…。最终当应用审核通过后,用户可在 AppStore 更新 1.2.3 版本,下次上传 AppStore 发布正式版本号将递增使用 1.2.4

    原文作者:includecmath
    原文地址: https://segmentfault.com/a/1190000014474195
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞