Bitcode
是 Xcode7
的新特性。
查看 Bitcode:
TARGETS -> Build Settings -> 搜索Enable Bitcode
可在工程中配置,設置為 YES/NO
Bitcode 官方說明:
官方:
Bitcode is an intermediate representation of a compiled program. apps you upload to App Store 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 App Store.
For iOS apps, bitcode is the default, but optional. For watchOS and tvOS apps, bitcode is required. If you provide bitcode, all apps and frameworks in the app bundle (all targets in the project) need to include bitcode.
翻譯:
Bitcode是編譯后的程序的中間表現,包含Bitcode并上傳到App Store Connect的Apps會在App Store上編譯和鏈接。包含Bitcode可以在不提交新版本App的情況下,允許Apple在將來的時候再次優化你的App 二進制文件。
對于iOS Apps,Enable bitcode 默認為YES,是可選的(可以改為NO)。對于WatchOS和tvOS,bitcode是強制的。如果你的App支持bitcode,App Bundle(項目中所有的target)中的所有的Apps和frameworks都需要包含Bitcode。
根據以上描述可以基本了解Bitcode。
下面還有兩點注意事項:
- 在項目中使用時,我們也是主要會根據某些Framework或.a的時候是否支持
Bitcode
來決定我們的項目是否支持Bitcode
. - 在我們需要生成
dsym
時,必須開啟Bitcode
。dsym
文件是在應用發生崩潰或者其他情況后,根據dsym
文件進行相應定位解析。