- Home /
The question is answered, right answer was accepted
Huge iOS Build
Hello,
I am developing a 2D game for mobile devices. I am using a lot of sprites in my project. My problem is;
-When I build for Android, my apk is around 50 MB which is quite normal.
-When I build for iOS, my build is around 450 MB and when I archive it in Xcode it gets 995 MB. (710, when I disable bitcode.) When I upload to iTunes Connect, it says compressed size is about 230 MB. And it's size on my iPhone is 530 MB.
I couldn't understand what is happening there.
Any idea or experience like this?
Edit: I have checked ipa sizes on iTunesConnect once it's finished processing. Ipa files are around 45 MB, which looks normal but install sizes are around 450 MB. Any ideas on how to decrease sprite sizes? I have ~300 sprites (each one takes 1.3 MB in the build.)
Answer by phil_me_up · Apr 04, 2016 at 09:37 AM
300 sprites with each one being 1.3Mb? That seems huge.
Can you do any compression / packing at all? Can you make them PoT and use PVR compression (the device will thank you for lower memory usage if you can!)?
Aside from compression, there are a few things you should understand about iOS builds.
Firstly, it's likely that you are generating both the 32bit and 64bit executables. This is as intended and it will therefor make the size slightly larger on iOS.
Secondly, it's like that the XCode archive includes your dSym files (for de-symbolicating). Again, this is as intended and isn't going to be part of the downloaded ipa for the player. From the archive you can open the package and extract just the ipa contents to give yourself a better idea of the size without dyms. You can also ask XCode not to generate the dsyms if that helps during testing.
Thirdly, when you upload to apple, the will take the ipa contents, remove the executables, encrypt the contents, re-ad the executables and then compress. Unfortunatly for Unity, this seems to increase the build size quite dramatically. I'm not sure why but I'm guessing the build must contain a lot of contiguous zeros. The rule here is that if the ipa you are uploading is say 80Mb, the download for the player will probably be over 100Mb. It is slightly game specific though.
Fourthly (if that's as a word), the install size on the device is always much bigger. You'll note that the first time you run the game on the device the loading time is longer than normal. This is because it's decompressing.
Unity does publish some general guides on how to reduce build sizes too (stripping, framework usage etc). Might be worth looking through them: http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html
I solved my problem by converting all my sprites to PoT(just put margin to not lose any quality). I was confused because I developed exact same game with exact same sprites in Swift before and it took only 45 $$anonymous$$B memory on the device(when installed). I don't know what Xcode is doing with sprites but looks efficient. Yesterday after changing all my sprites to PoT, I managed to reduce ipa size to 33 $$anonymous$$B and installed size to 95 $$anonymous$$B. Still bigger than native app but close enough.
Follow this Question
Related Questions
Build Server, both Android and iOS 0 Answers
My iPA is much larger than my apk 0 Answers
iOS Xcode Archive size is extreme 0 Answers
App size increased when ported to IOS 0 Answers