本文介绍了iOS App Store bundle 版本比较规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将把我们应用的新版本上传到 iOS App Store.

We are going to upload new version of our app to iOS App Store.

对于以前的版本,CFBundleShortVersionString 是1.9.2",CFBundleVersion 是1.92.0".对于当前版本,我们将使用 CFBundleShortVersionString:"1.10" 和 CFBundleVersion:"1.100.0".

For previos version CFBundleShortVersionString was "1.9.2" and CFBundleVersion was "1.92.0". For current version we are going to use CFBundleShortVersionString:"1.10" and CFBundleVersion:"1.100.0".

但我们担心 App Store 不会将我们的 1.10 版本检测为新版本.使用 CFBundleVersion:"1.92.0" 时,它不会被识别为比以前的版本旧.

But we afraid if App Store won't detect our 1.10 version as new. Won't it be recognized as older than previos version with CFBundleVersion:"1.92.0".

换句话说,CFBundleVersion:"1.100.0" 会高于 CFBundleVersion:"1.92.0" 吗?

In other words, is CFBundleVersion:"1.100.0" will be higher than CFBundleVersion:"1.92.0" ?

有人知道 Apple 如何比较上传构建的 CFBundleVersion 参数吗?

Does anybody know how Apple compare CFBundleVersion parameter of uploaded builds?

感谢您的回答.

推荐答案

是的,1.100.0 是 > 1.92.0.Apple 使用语义版本控制.

Yes, 1.100.0 is > 1.92.0. Apple uses semantic versioning.

从左到右,只要没有一个数字小于新数字,就是好的.

From left to right, as long as none of the numbers are less than the new number, you are good.

就您的示例而言,支票类似于(伪):

For your example, the check goes something along the lines of (pseudo):

var oldVersionSems = "1.92.0".split(".")
var newVersionSems = "1.100.0".split(".")
var maxIndex = MIN(oldVersionSems.length, newVersionSems.length)
var isNewer = false
for (int i = 0; i < maxIndex, i++) {
    isNewer = newVersionSems[i] > oldVersionSems[i].toInt()
    if (isNewer) break
}

关于语义版本控制如何工作的一个很好的资源是 http://semver.org

A good resource for how semantic versioning works is http://semver.org

示例:

  • 2.0.0 > 1.100.0
  • 1.20.0
  • 1.1.0 > 1.0.500
  • 1.92.0

这篇关于iOS App Store bundle 版本比较规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 23:13