tags:

views:

258

answers:

2

Hi,

I am looking for ways to reduce the size of my iPhone application. Currently the size of the app in my debug-iphonesimulator folder is 112 MB and the size in debug-iphoneOS is 57 MB.

I have about 13 view controllers (including navigation controller, tabbar controller etc). The size of my sqlite3 db is only 50 kb.

I have 100 images and 50 thumbnails , all in png format. The resolution of each picture is 300 X 300 ppi. I understand one way to reduce the size is to compress the images. What is the best way to do compression without great loss in quality? What resolution is reasonably a good resolution?

I would also greatly appreciate any other tips to reduce the size.

Thanks.

A: 

PNG is really the best option for lossless image compression. You can optimize your PNGs for size using PNGOUT, but may I inquire which files specifically are taking much space? How does it compare to a non-debug release?

Edit: If you'd like a free GUI-version of PNGOUT, take a look at PNGGauntlet.

Paul Lammertsma
I tried PNGOUT for a couple of images. It squeezes out some 10s of kb from the pictures. For 100 pictures, there might be a saving of around 2 mb. So if PNG is really the best option,I am thinking about reducing the physical dimensions of the picture. The problem again is those pictures contain something called "actual size" of insects. I guess i would have lots of work to do to seperate them as layers and reducing the dimensions of some layers and flattening them out to make a png. I guess i would keep PNGOUT as the last step to squeeze out a couple of more MBs. Thanks for the suggestion.
Sudharsanan
A: 

A debug build will usually be much larger than a release build. Try building in release mode.

There's a few compiler options that may help too. Not sure whats default for iphone release mode though. -Os will optimize for a smaller binary. There's also an option for dead code stripping that will remove any code that can never be run. Also you might try stripping the binary .. not sure if that works for iphone binaries though.

This is assuming that your problem is due to executable binary size and not the image resources.

Michael Anderson
Thanks for the suggestion. I tried doing it in the release mode. The simulator version is 48.3 mb and the iPhone version is 55.9 mb. Simulator version has reduced by more than half while the iPhone version got reduced by only 1 mb. I am not sure how to separately calculate the executable binary from image resources. I am doing some code clean up but i see that image resources take up much of the space.
Sudharsanan