Bitcode是什么作谚?
App Distribution Guide – App Thinning (iOS, watchOS)一節(jié)中焙压,找到了下面這樣一個(gè)定義:
Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.
說(shuō)的是bitcode是被編譯程序的一種中間形式的代碼。包含bitcode配置的程序?qū)?huì)在App store上被編譯和鏈接抑钟。bitcode允許蘋果在后期重新優(yōu)化我們程序的二進(jìn)制文件涯曲,而不需要我們重新提交一個(gè)新的版本到App store上。
在What’s New in Xcode-New Features in Xcode 7中在塔,還有一段如下的描述
Bitcode. When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary.
當(dāng)我們提交程序到App store上時(shí)幻件,Xcode會(huì)將程序編譯為一個(gè)中間表現(xiàn)形式(bitcode)。然后App store會(huì)再將這個(gè)botcode編譯為可執(zhí)行的64位或32位程序蛔溃。
Bitcode配置
錯(cuò)誤提示绰沥,如何處理以下的問(wèn)題:
You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64
要么讓第三方庫(kù)支持,要么關(guān)閉target的bitcode選項(xiàng)贺待。
實(shí)際上在Xcode 7中徽曲,我們新建一個(gè)iOS程序時(shí),bitcode選項(xiàng)默認(rèn)是設(shè)置為YES的麸塞。我們可以在”Build Settings”->”Enable Bitcode”選項(xiàng)中看到這個(gè)設(shè)置秃臣。
不過(guò),我們現(xiàn)在需要考慮的是三個(gè)平臺(tái):iOS,Mac OS奥此,watchOS弧哎。
對(duì)應(yīng)iOS,bitcode是可選的稚虎。
對(duì)于watchOS撤嫩,bitcode是必須的。
Mac OS不支持bitcode蠢终。