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

查看:362
本文介绍了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/advanced_topics/linker/#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会增加它自己的空间。加密到您的应用程序,可以显着增加整体大小。由于加密模糊了模式,因此生成的压缩应用程序将更大。影响因app而异。将数据(例如长字符串或表格)移出代码并移入外部文件将使最终下载更小,因为这些文件将更有效地压缩。

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天全站免登陆