2

I made an iPhone app and it was relatively large at ~40mb+; later I diminished all the PNG images that I use, which resulted in the original ~110mb+ project file being reduced to ~40mb+.

However, when I rebuilt my app I found that the product myApp.app is still ~40mb+, even a little more than before.

So why is this, how can I reduce the size of my app?

Grant Thomas
  • 44,454
  • 10
  • 85
  • 129
Wang Liang
  • 941
  • 2
  • 15
  • 34
  • 1
    Squeeze harder? Do you have 40 megabytes worth of compiled code? or are you embedding a bunch of resources like music, images, video, etc...? – Marc B Mar 01 '12 at 16:22
  • 1
    possible duplicate of [How to reduce the size of my iPhone application?](http://stackoverflow.com/questions/2490910/how-to-reduce-the-size-of-my-iphone-application) – Richard Stelling Mar 01 '12 at 16:23
  • This is actually a very common question on stackoverflow. – Almo Mar 01 '12 at 16:25
  • @rjstelling Not quite, since the OP already has 'the solution' but is having peripheral trouble warranting another question (whether or not it is a greatly valid question for SO or not is another matter.) – Grant Thomas Mar 01 '12 at 16:28

3 Answers3

7

Look at the content of the app bundle to find the sizes of the various components.

In organizer select "projects", select your project, click on the little arrow at the end of the item and you will be in the directory containing your app Navigate down to the .app, right-click and select "Show Package Contents". Examine the items and their sizes.

That should allow you to understand where the size is coming from and perhaps reduce it.

zaph
  • 111,848
  • 21
  • 189
  • 228
2

By default Xcode undoes image optimisations, so you must fix Xcode config to prevent that.

Kornel
  • 97,764
  • 37
  • 219
  • 309
0

Look at the sizes of all your object files and the other data that gets loaded into the application during packaging. That will fairly quickly tell you where the space is getting used. (Be sure to look at the individual .o files that go into your final binary.)

Perry
  • 4,363
  • 1
  • 17
  • 20