Xamarin iOS 中的 ipa 文件大小问题 [英] ipa file size issue in Xamarin iOS

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

问题描述

昨天我创建了 IPA 文件,它显示估计的应用商店大小为 100 mb,今天我也尝试创建 IPA,但它显示的估计应用商店大小为 525 mb.

Yesterday i have created IPA file and it was showing estimated app store size is 100 mb and today i also tried to create IPA but its showing estimated app store size is 525 mb.

我阅读了苹果接受 IPA 文件的说明:

I read apple instruction for accepting an IPA file :

Apple 支持最大大小为 2GB.可执行文件大小不应大于 60 MB.

Apple support maximum size 2GB. Executable size should not be grater then 60 MB.

我在我的代码中看到bin"和obj"是由 1.5 和 5.5 gb 组成的文件夹.支持的架构设置为 ARMV7 和 ARMV64,链接行为为 NONE.

i saw that "bin" and "obj" are the folder consisting 1.5 and 5.5 gb in my code.and supported architecture set as ARMV7 and ARMV64 with linking behavior as NONE.

有什么办法可以减小 ipa 文件的大小?

Any Solution for reducing the ipa file size?

推荐答案

Xamarin 应用程序的大小略大于 Objective-C 应用程序,因为 Mono 框架是应用程序包的一部分.

Xamarin app sizes are slightly bigger than Objective-C apps as the Mono framework is part of the app bundle.

您构建的架构也会增加应用程序的大小,因为将为每个架构创建一个二进制文件 - 我建议您只为 ARMv7 和 ARM64 构建,省略 ARMv7,除非您需要利用该架构提供的特定优化.

The architectures you build for will also increase the app size as a binary will be created for each one - I suggest that you only build for ARMv7 and ARM64, omitting ARMv7s unless you need to utilise the specific optimisations provided with that architecture.

您可以通过设置链接器选项来链接发布配置中的所有程序集,从而潜在地减小应用程序的大小.请注意,如您的问题所述,将链接器设置为 none 将不利于您的应用大小.

You can potentially reduce the app size by setting the linker options to link all assemblies in your release configuration. Note that setting the linker to none, as stated in your question, will be detrimental to your app size.

https://developer.xamarin.com/guides/ios/高级主题/链接器/#Link_all_assemblies

添加到项目中的每个 nuget 包也会增加应用的大小.但是,通过使用链接器,其影响将取决于您实际使用的包的数量.任何未使用的东西都将在链接过程中被删除.

Each nuget package added to your project will also increase the size of your app. However, with the use of the linker, the impact of this will depend on how much of the package you are actually using. Anything unused will be stripped out during the linking process.

您还可以通过查看应用中包含的其他资产(例如图像)来减小应用大小,并查看是否可以通过将它们变小或增加压缩来节省空间.

You can also reduce your app size by looking at what other assets you have included in your app, such as images, and see if you can save space by making them smaller or increasing compression.

最后要注意的是,在您将应用上传到 iTunes Connect 后,App Store 会将其自己的加密添加到您的应用中,这会显着增加整体大小.由于加密会混淆模式,因此生成的压缩应用程序会更大.影响因应用程序而异.将数据(例如长字符串或表格)从代码中移出并移入外部文件将使最终下载的文件更小,因为这些文件的压缩效率更高.

As a final note, after you upload your app to iTunes Connect, the App Store adds it's own encryption to your app which can significantly increase the overall size. As encryption obfuscates patterns, the resulting compressed app will be larger. The impact varies from app to app. Moving data, such as long strings, or tables, out of code and into external files will make the final download smaller, because those files will be compressed more efficiently.

这篇关于Xamarin iOS 中的 ipa 文件大小问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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