Julio Gorgé

Tips to keep your iPhone app small

Keeping the size of your iPhone App to a minimum is interesting because of many reasons, but probably the most important of them is Apple’s 10 MB app size limit to App Store downloads over cellular networks (3G or EDGE). Mind you, this limit to OTA downloads applies to final compressed (zipped) size. Although compressing you app bundle with the “Compress” Finder action will give you an fairly accurate estimate of the final download size, be aware that the iTunes Connect metada might increase size in a couple hundred kilobytes.

Keep reading for two tips on reducing the size of your iPhone apps.

1. Pack images together offline

By store related images on a single image “atlas” with an offline image packing tool, you can save precious disk space, as you get rid of the overhead of multiple image file headers. As a collateral benefit, you also get a loading time speed up (it’s faster to load a single big image than multiple small ones). Also, if you have many PNG32 images (as in a hidden-object game), consider packing them into two JPEG atlases. That’s what we did for Herod’s Lost Tomb:

By packing all hidden objects from each level into two color and an alpha JPEG images, the combined size of each level’s hidden objects on disk was reduced from ~800 KB to ~250-300 KB.

 
2. Use compressed audio wherever possible

Most developer default to AAC files for music and CAF files for sound effects. Although the playback of both formats are reportedly hardware accelerated on the iPhone, only the former is a compressed format. Why does that matter? Well, because you are probably more worried about disk size than ultra-low CPU usage, you might want to ditch CAF files in favor of OGG/Vorbis ones. It’s relatively easy to implement a sound engine around OpenAL and libogg. By converting a sound effect of, say, 4 seconds at 22Khz and 16 bit from CAF to OGG, you would be saving around 180 KB of space (200 KB – 20 KB). Multiply that by the number of sound effects used in your game and you will quickly realize you that converting all sfx to OGG would tranlate into savings of one to two megabytes.

If you know of other techniques to optimize app size, we’d love to hear them.

Leave a Reply