20MB Limit: Finding the Real Size of an App BinaryBy Ross on December 21st, 2011 in Technobabble
Tags: appstore, development, gotchas, tips
In our language learning products Japanese Flash & Chinese Flash, we have quite large sql files. This puts us over the 20MB limit for downloading our app via 3G. We have found that this has a pretty big impact on sales, and now we make every effort to fit the bundle under that 20MB limit. In this post I’ll discuss how to find the maximum size of an app binary before you submit it for review.
The first time I went through the process of cutting down a binary size, I got the .ipa file to about 19.5MB. Great! I’m done. Then I submitted to Apple and after the 10 days wait it went live at 20.5MB, over the limit. What happened?
As it turns out, Apple encrypts your compiled code before compressing into a .ipa file. The result is your code might be compressed some, might be compressed not at all. The .ipa size on your machine is not always going to be the same as the final for sale app. Given the affect on sales, this won’t do.
We can compute the maximum size of the binary possible by assuming the compressed code will get zero encryption, while all of our images and other resources have the standard compression. Here’s how:
1. Open the Organizer Window and find the Archived app you are planning to upload, the right click and select “Show In Finder”:
2. Right click the archive and select “Show Package Contents”
3. Find the App in the Products -> Applications folder, make a copy, right click and again choose “Show Package Contents”.
4. Find the compressed code, the filename will be the same as the bundle, in our case jFlash. Note the size of this file and remove it from the bundle.
5. Compress the remaining files.
6. Add the compressed files size to the uncompressed size of the removed code file. This will be the maximum size the bundle can be. Usually it will end a little smaller than this once live on the app store.
There you go. If you can get the maximum bundle size to 20MB or under, you will have no trouble with uploaded binaries being larger than you thought.
This caused us a bit of pain, I hope this helps you avoid the same issue. Happy coding!