Bitcode

Bitcode简介

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.

苹果官方对Bitcode的评价描述是,Bitcode是被编译程序的一种中间形式的代码。包含Bitcode配置的程序将会在App store上被编译和链接。目的是为了减少App的安装包大小,使用户不必下载不适合自己系统的那部分资源

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.

当我们提交程序到App store上时,Xcode会将程序编译为一个中间表现形式(Bitcode)。然后App store会再将这个Bitcode编译为可执行的64位或32位程序。

Bitcode配置

在实际开发中,需要考虑的是三个平台:iOS,Mac OS,watchOS。

  1. 对应iOS,Bitcode是可选的。
  2. 对于watchOS,Bitcode是必须的。
  3. Mac OS不支持Bitcode。

方法一:更新library使包含Bitcode,否则会出现以下中的警告;

(null): URGENT: all bitcode will be dropped because '/Users/myname/Library/Mobile Documents/com~apple~CloudDocs/foldername/appname/GoogleMobileAds.framework/GoogleMobileAds(GADSlot+AdEvents.o)'
 was built without bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. Note: This will be an error in the future.

方法二:关闭Bitcode,在”Build Settings”->”Enable Bitcode”选项中看到这个设置。



作者:DevKyle
链接:https://www.jianshu.com/p/4efd2a8215e0
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值