As you probably know, Apple has an app download limit for users downloading over 3G. Up until recently, this limit was 10 MB. If your app's file size exceeds the limit, users attempting to download it over 3G receive an error and must try again later over wifi. Needless to say, this can lead to frustrated users and lost sales and if you can get your app under this limit, it's definitely worth the effort.
So, when we submitted our latest update of Pig Rush to Apple for review, we worked hard to get it under the (then) 10 MB 3G app download limit.
Eventually, we got the file size down to 8.9 MB, knocking a massive 66% off of the original file size. Awesome!
We then submitted our update to Apple for review. Amazingly, only 12.5 hours later it was approved and live on the App Store. Excellent!
Then we noticed the file size listed in the App Store… 16.5 MB.
How could this be? This was nearly double the size of what what we submitted!
We downloaded the compressed package from the app store, and compared it to the version we uploaded. Sure enough, the version on the App Store was larger: 17.4 MB vs. our 8.9 MB version.
We extracted both files to compare, but apart from some standard config files added everything was the same.
Upon further inspection, it turned out there was one big difference: the main executable was 13.7 MB in both versions. However, the App Store version of this file compressed to 12.4 MB while ours compressed to 4 MB.
That's a pretty significant difference. We decided to ask Apple about this, and here's the answer we got:
"When your application is delivered to Apple, it is encrypted for DRM purposes and re-compressed. When the encryption is added, the size of the compressed file will increase. The exact size of the increase will vary from app to app, however, the size increase can be large when the binary has a lot of contagious zeros in it. We are unable to guarantee the size of your file after the encryption has been added."
File size increasing after encryption is added makes sense - but an increase from 4 MB to 13.7 MB seems extremely high. I've also never heard of "contagious zeros" before, and it looks like I'm not the only one.
Luckily, the new 3G limit has been upped to 20 MB so we still fall under it, but I'd still be interested in hearing others' experiences in final app package size vs. what was uploaded. Also, if you have any suggestions on limiting the number of contagious zeros in your binaries, please let us know.