忽然之間,你就會發現,Bitcode什麼鬼???這是什麼鬼?
服務器
在Apple官方文檔中提到了這一段微信
Bitcode is an intermediate representationof a compiled program. Apps you upload to iTunes Connect that contain bitcodewill be compiled and linked on the App Store. Including bitcode will allowApple to re-optimize your app binary in the future without the need to submit anew version of your app to the store.app
哈哈,看不懂的話,我幫你有道翻一下!優化
說的是bitcode是被編譯程序的一種中間形式的代碼。包含bitcode配置的程序將會在App store上被編譯和連接。bitcode容許蘋果在後期從新優化程序的二進制文件,而不須要從新提交一個新的版本到App store上。ui
翻譯出來也是苦澀難懂,大體意思就是bitcode這種東西是編譯程序時候,一種用來過渡用的代碼形式,就像咱們拋送去服務器的UTF-8代碼形式同樣的!this
接下來再看一段!spa
Bitcode. When you archive for submission tothe 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 bitexecutables as necessary.翻譯
這個翻譯就是:當提交程序到App store上時,Xcode會將程序編譯爲一箇中間表現形式(bitcode)。而後App store會再將這個botcode編譯爲可執行的64位或32位程序。code
大體意思就是,這個鬼東西就是跟前一段時間app大瘦身有關,自從蘋果出手表之後,固然是包作的越小,內存佔有越小,耗電耗能越小,最好!因此出來的這個鬼東西比較讚的!orm
Bitcode配置
在上面的錯誤提示中,提到了如何處理咱們遇到的問題:
You must rebuild it with bitcode enabled(Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, ordisable bitcode for this target. for architecture arm64
要麼讓第三方庫支持,要麼關閉target的bitcode選項。
實際上,在Xcode 7中,咱們新建一個iOS程序時,bitcode選項默認是設置爲YES的。咱們能夠在」Build Settings」->」Enable Bitcode」選項中看到這個設置。
可是,咱們如今須要考慮的是三個平臺:iOS,Mac OS,watchOS 哎呦,真是蛋疼咯!
對於iOS,bitcode是可選的;對於watchOS,bitcode是必須的,必須的就是強制瘦身咯,你必需要分開的;而Mac OS是不支持bitcode,這個支持會是什麼鬼?萬一換一下位數就不嫩那個用了!
若是咱們開啓了bitcode,在提交包時,下面這個界面也會有個bitcode選項:
因此,若是咱們的工程須要支持bitcode,則必要要求全部引入的第三方庫都支持bitcode。
經過本文對bitcode的概念及配置狀況的簡要介紹,但願iOS開發人員在工程運行中遇到相似的狀況,能夠根據上文的介紹更有效的找到緣由並及時處理。
若是個人文檔對您有幫助,麻煩關注一下個人公
衆微信號,天天學一點,開發更輕鬆!