App file size differences in Android and iOS

后端 未结 4 2010
栀梦
栀梦 2021-02-05 02:14

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

The file size of an app is in general larger for an Apple a

4条回答
  •  遥遥无期
    2021-02-05 02:49

    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.

    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.

    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).

提交回复
热议问题