在Xamarin iOS中启用位码 [英] Enable bitcode in Xamarin iOS

查看:83
本文介绍了在Xamarin iOS中启用位码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用Xamarin Forms为iOS和android开发了一个跨平台.我的应用程序使用多个屏幕和一些tjird party依赖项,例如Facebook,google maps和firebase.

一切正常,直到我在发布模式下对其进行编译为止.假设我要同时支持armv7和arm64,这些是应用程序的大小: *无需链接和优化:103mb. *完全优化(链接所有+ LLVM):73mv.

有了优化,没有armv7,我得到了40mb-这是我想要的结果大小.

为解决此问题,我认为应该启用位码编译.但是,即使使用包括Mac和Mono v5的Visual Studio在内的alpha工具,启用此功能时,我仍会收到不支持平台:iOS"的信息.另一方面,我检查了源代码,发现mono确实允许它,而且它们还允许观看和电视应用程序,这需要位代码...

有人知道如何为iOS启用它吗?我会为我提供巨大的(!)帮助!

谢谢!

解决方案

所以我找不到任何解决方案,因此不得不提交不带位码支持的应用程序. 但是,对于将来可能会解决此问题并希望由于应用程序大小而使用位码的每个人-我想澄清一下:作为iOS 9 App Thining的一部分,位码仅与未来相关架构发布,即当您将arm7 + arm64应用程序上传到App Store时,Apple会自动对其切片,而无需您采取任何行动(除了链接您的代码(全部链接")并支持这两种架构).

您可以检查估计的应用程序大小,但您不应在Xamarin Studio中进行操作,因为它显示的是通用应用程序版本,而不是设备专用的精简版本.要检查设备X的尺寸,您应该:

  • 创建Ad-Hoc分发配置文件Apple开发人员网站.
  • 在Xamarin Studio中创建档案.
  • 打开Xcode(如果以前已打开-关闭重新打开).
  • 打开管理器.
  • 点击导出,然后点击即席".
  • 您应该会看到一个对话框,询问您是否要使用通用ipa或特定于设备的ipa. 通用IPA 是包含每个设备的数据的通用IPA,因此您可以将其发送给每个人.此ipa的大小将是您在Xamarin Studio中看到的大小(压缩前).特定于设备的Ipa是执行Thining之后用于特定设备的Ipa.这是您的用户将下载的ipa.因此-选择您要检查的设备.

现在,您将能够获得与该设备的大小相匹配的设备特定的ipa.请注意,相同的信息将在您上传内部版本后显示在iTunes Connect中.

请参阅:

所以总结一下:当前,您不能在Xamarin应用程序(显然是iOS和Forms)中使用位码.该选项确实存在于mono中,但并未包含(已在出厂的mono运行时中明确禁用了该选项).但是,这并不意味着Xamarin Studio中显示的估计应用程序大小将是您用户的应用程序大小,因为它在iOS 9+ App Thining功能上有所不同,该功能不需要激活位码.

I've developed a cross platform for iOS and android using Xamarin Forms. My app uses several screens and some tjird party dependencies such as Facebook, google maps and firebase.

Everything works good until I went to compile it in release mode. Assuming I want to support both armv7 and arm64, these are the app size: * without linking and optimization: 103mb. * with full optimization (link all + LLVM): 73mv.

With the optimization and without armv7 I'm getting 40mb - that's my desired result size.

To solve this issue I thought that I should enable bitcode compilation. However, even with the alpha tools, including visual studio for mac and mono v5 I'm getting "platform not supported: iOS" when enabling this feature. On the other hand, I dogged at the source code and saw that mono does allow it, and besides they allows watch and tv apps, which requires bitcode...

Does anybody knows how to enable it for iOS? I'll be huge (!) assistance for me!

Thanks!

解决方案

So I couldn't find any solution and had to submit my app w/o bitcode support. However, for everyone who may tackle this issue in the future and wish to use bitcode because of app size - I want to clarify this: Bitcode, as part of iOS 9 App Thining, is only relevant to future architecture releases, i.e. Apple will auto-slice your arm7+arm64 app when you'll upload it to the App Store, without any action from your side (besides linking your code ("Link All") and supporting both architectures).

You can check the estimated app size, but you shouldn't do it in Xamarin Studio since it shows the universal app version, and not the device-specific thinned one. To check what the size will be for device X, you should:

  • Create Ad-Hoc Distribution profile Apple Developer Site.
  • Create an archive at Xamarin Studio.
  • Open Xcode (if it was previously opened - close an re-open).
  • Open the Organizer.
  • Click on Export, then on "Ad Hoc".
  • You should see a dialog asking if you want universal ipa or device specific ipa. Universal IPA is a generic IPA containing the data for every device, so you can send it to everyone. The size of this ipa will be the size you saw in Xamarin Studio (before compression). A device-specific ipa is an ipa for specific device, after performing Thining. This is the ipa your users will download. So - select the device you wish to check.

Now you'll be able to get a device-specific ipa which matches the size for this specific device. Note that the same information will appear in iTunes Connect after you'll upload your build.

See:

So to summarize it: Currently you can't use bitcode in Xamarin apps (iOS and Forms, obviously). The option does exists in mono, but not included (it was explicitly disabled in the shipped mono runtime). However, that doesn't mean that the estimated app size that's being displayed in Xamarin Studio will be your users app size, since it varies on iOS 9+ App Thining feature, which doesn't need bitcode to be activated.

这篇关于在Xamarin iOS中启用位码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆