最近岸晦,我們要提交 App 到 Apple 的 App Store,涉及到后續(xù)版本(version)升級(jí)的問題睛藻,Google 了一下启上,大家有不少類似的困擾,見解也是五花八門店印。
感謝 @NoteCode 澄清概念和截圖演示冈在。
選用方案
先說一下我們選用的方案,有時(shí)間的話大家可以閱讀全文按摘,了解一下對(duì) iOS App 各色 "版本" 的理解讥邻。
格式定義
- version#(版本編號(hào))
= version number in iTunes Connect
= Bundle versions string, short in Xcode;
= CFBundleShortVersionString in Info.plist院峡;
遵循軟件版本一般約定兴使,使用三段式 x.y.z,如 0.5.1照激。若 z 為0发魄,則通常省略,比如:記為 1.1 而不是 1.1.0俩垃。
沒有特別說明励幼,我們所說的 版本 指的就是這個(gè)意義上的版本編號(hào)。
通過 iTunes Connect 提交 Apple 時(shí)使用口柳。
iTunes Connect 對(duì) version 的要求:The version number of the app you are adding. Numbering should follow software versioning conventions.
- build#(build編號(hào))
= Bundle version in Xcode苹粟。
= CFBundleVersion in Info.plist
選用一個(gè)正整數(shù)來表示build#,每構(gòu)建/提測一次跃闹,這個(gè)數(shù)字就加1嵌削。
如:上次構(gòu)建/提測為1毛好,則本次就是2,下次就是3苛秕。
沒有特別說明肌访,Bundle version 這個(gè)術(shù)語等同于 build#。 -
version number in iTunes Connect
和 Bundle versions string, short 保持一致艇劫,即上面說的 version#吼驶。 - 擴(kuò)展版本
選用:version# (role#build#),如 0.5.1 (C2)店煞;
其中:role# 表示角色編號(hào)蟹演,B 表示 經(jīng)紀(jì)人版,C 表示 客戶版顷蟀;version# 后面有一個(gè)空格轨帜; - App About(關(guān)于)
正式版:依擴(kuò)展版本格式定義,如:0.5.1 (C2)衩椒;
開發(fā)版:擴(kuò)展版本格式后加 D蚌父,如:0.5.1 (C2) D。 - 禪道
在禪道中構(gòu)建/提測時(shí)毛萌,遵循擴(kuò)展版本格式定義苟弛。
x.y.z 的含義
- x 大更新
major updates of the application, such as updates that implement new features or major changes. 自然地,0 則表示產(chǎn)品尚未成型阁将。 - y 小更新
The second integer denotes revisions that implement less prominent features. - z 維護(hù)更新
The third integer represents maintenance releases. 比如:上線后發(fā)現(xiàn)問題膏秫,修正后,z 就要加 1做盅。z從0開始缤削。
x, y, z 的約定
- 取值范圍
x, y, z 必須為 0 或者 正整數(shù),數(shù)字前請(qǐng)不要用0做前綴吹榴。2.1.6 是合適的亭敢,而 2.1.06 就匪夷所思,不合適图筹。 - 版本比較算法
版本的大小比較是以逗點(diǎn)分割后帅刀,逐段比較數(shù)字大小,比如:2.1.11 比 2.1.3 版本高远剩,因?yàn)?11 > 3扣溺;1.3.4 比 1.2.9 版本高,因?yàn)?3 > 2瓜晤。
內(nèi)部可直接使用 role#build# 稱呼打包編號(hào)
因?yàn)?build# 單一且始終增長锥余,具有簡單性、連續(xù)性和唯一指向性痢掠。比如 C3 包驱犹,B5 包嘲恍,在開發(fā)團(tuán)隊(duì)內(nèi)部交流時(shí)使用會(huì)方便很多璧亮。
對(duì) iOS App "version" 的理解
-
Bundle versions string, short in Xcode
軟件的顯示版本,顯示在 App Store 里面檬贰,用戶能看到的包的版本號(hào)桑嘶。 -
Bundle version in Xcode
通常理解為 Build 編號(hào);
需要不斷增長颜价,既是語義的要求、可理解的要求,同時(shí)在 iTunes Connect 提交時(shí)也有新版本要比上一個(gè)版本高這個(gè)要求彬向;
和 Bundle versions string, short 沒有固定關(guān)系。 -
version number in iTunes Connect
在 iTunes Connect 提交認(rèn)證包時(shí)攻冷,你需要填寫版本編號(hào)娃胆。應(yīng)當(dāng)和 Bundle versions string, short 保持一致。-
iTunes Connect Developer Guide 在 General App Information 章節(jié) 對(duì) Version Number Property 的描述:
The version number of the app you’re adding. This is the version number that will display on the App Store for customers.
Numbering should follow typical software versioning conventions (for example, 1.0 , 1.0.1 , 1.1 ).
Important: Make sure this App Store version number matches the version number set in the bundle. If these don’t match, upload errors for later updates might occur. - one question and answers on Stack Overflow
- agvtool: Apple-generic versioning tool for Xcode projects
-
iTunes Connect Developer Guide 在 General App Information 章節(jié) 對(duì) Version Number Property 的描述:
- CFBundleVersion
在 Info.plist 文件中等曼,你會(huì)看到 CFBundleVersion 這個(gè) key里烦,她的值就是 Bundle version 的值。 - CFBundleShortVersionString
在 Info.plist 文件中禁谦,其值為 Bundle Versions String, Short 的值胁黑。
** Info.plist **
Property list 文件使用擴(kuò)展文件名 .plist,稱為 p-list 文件州泊,通常用來存儲(chǔ)用戶設(shè)置丧蘸,也常用來存儲(chǔ)關(guān)于 bundles and applications 的信息,這是一個(gè)xml文件遥皂。
示例
Target Properties
Target Properties.jpg
Info.plist
Info.plist.png
Xcode General
Xcode General.jpg
Product Archive 啟動(dòng)
Product Archive 啟動(dòng).jpg
Product Archive 結(jié)果
Product Archive 結(jié)果.jpg
Xcode 版本
Xcode 版本.jpg
iTunes Connect App(3.0.2)
iTunes Connect App(Products).png
iTunes Connect App(Settings).png
App About(關(guān)于)
App About(關(guān)于).png