Android 和 iOS 中的应用程序文件大小差异 [英] App file size differences in Android and iOS

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

问题描述

与应用分发服务(Android 市场和 Apple App Store)合作时,我发现了一个谜.

Working with both app distributions services (android market and Apple App store) I have discovered a mystery.

Apple 应用程序的文件大小通常大于 Android 应用程序的文件大小.我似乎找不到对差异的任何解释,这似乎是一个未触及的主题.

The file size of an app is in general larger for an Apple app than for a Android app. I can't seem to find any explanation for the differences, and it seems to be an untouched subject.

我尝试了很多不同的应用程序,差异似乎在几 MB 到 6-8 MB 之间.那么问题来了,为什么 Apple 应用程序的文件大小更大?额外的 MB 有什么用?

I have tried allot of different apps and the difference seems to vary between a couple of MB to 6-8 MB. So the question is, how come the file size is larger for Apple apps? What is the extra MB used for?

示例:

Android:918K - https://market.android.com/详细信息?id=bbc.mobile.news.ww

Android: 918K - https://market.android.com/details?id=bbc.mobile.news.ww

Apple:6.7 MB - http://itunes.apple.com/dk/app/bbc-news/id364147881?mt=8

Apple: 6.7 MB - http://itunes.apple.com/dk/app/bbc-news/id364147881?mt=8

由于一些垃圾邮件预防措施,我无法直接链接到其余部分.

安卓:1.2 MB

苹果:7.9 MB

安卓:2.1 MB

苹果:6.4 MB

安卓:727K

苹果:2.1 MB

我可以继续......如果有人可以提供两个应用程序分发的文件大小统计数据,证实或反驳我的理论.- 我将不胜感激.

I could go on... If anyone can provide a statistics of file size for the two app distributions, confirming or disproving my theory. - I would appreciate it allot.

推荐答案

我刚刚花了最后一天左右的时间试图追踪这个确切的问题.我为 Android 构建了一个名为 BlockIT 的小游戏,现在我有一个适用于 iOS 的运行版本.极其奇怪的是,Android 版为 8.2 MB,iOS 版为 14.1 MB.

I have just spent the last day or so trying to track this exact problem down. I have built a little game called BlockIT for Android, and now I have a running version for iOS. The extremely odd thing is that the Android version is 8.2 MB and the iOS version is 14.1 MB.

现在,由于我是源的所有者,我想追踪并找出原因.正如许多人在这里建议的那样,它是图形元素 - 事实并非如此.每个包中的整个数据集(非代码)几乎相同.这是有道理的,因为我在每个应用程序中使用相同的图形.

Now, since I am the owner of the source, I wanted to track this down and find out why. As many suggest here that it is the graphical elements - this is not the case. The entire data set (non code) was almost identical in each package. Which makes sense since I am using the same graphics in each application.

那么,为什么代码构建如此不同!我的 iOS 代码构建接近 7 MB,而 Android 代码不到 3 MB.代码本身被编写为以相同的方式运行,并且除了一小部分代码之外的所有代码在每个平台上都完全相同.我发现构建(iOS gcc)设置对您获得的输出大小有很大影响.如果您仅设置为面向 ARM6 或 ARM7,那么我的代码二进制文件的大小将从 7 MB 下降到 5 MB.这表明一个二进制文件中的每个目标几乎都有完整的函数和库副本!此外,内置的调试符号似乎没有被完全剥离.最后,代码的加密也需要大量成本.这可能是最令人费解的,因为 Android 以类似的方式对其 apk 进行签名.貌似iOS签名做的很奇怪.

So, why is the code build so much different! My iOS code build was nearly 7 MB and the Android one was less than 3 MB. The code itself was written to run identically and all but small portions of code are exactly the same on each platform. What I found was that the build (iOS gcc) settings had massive effects on what size of output you get. If you set only to target ARM6 or ARM7 then the size of my code binary dropped from 7 MB to 5 MB. This indicates there are almost complete duplicates of functions and libraries for each target in the one binary! Additionally, the built-in debugging symbols dont seem to get entirely stripped. Finally, the encryption of the code also costs large amounts. This is probably the most puzzling, since Android signs their apk's in a similar fashion. It seems that the iOS signing is done very oddly.

所以,我希望这会有所帮助.重申:
- 图像/数据似乎不是问题
- 在 iOS 上构建代码会在一个二进制文件中生成多个平台输出 == 大量额外代码(顺便说一句,我不知道 Apple 为什么这样做 - 看起来很奇怪).
- 代码加密在 iOS 上的大小不太友好.

So, I hope that helps. To reiterate:
- Images / Data don't seem to be the problem
- Code building on iOS generates multiple platform output in the one binary == lots of extra code (btw I dont wee why Apple does this - seems odd).
- Code encryption is not very size friendly on iOS.

没有真正的方法来解决实际问题(再次,奇怪和令人失望).

There's no real way to fix the actual problem (again, odd and disappointing).

这篇关于Android 和 iOS 中的应用程序文件大小差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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