Enable bitcode in Xamarin iOS

安稳与你 提交于 2019-12-11 06:27:42

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/43317580/enable-bitcode-in-xamarin-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!