What generates the size of an app?

Firstly, I’m a little confused on what the final size on the App Store will be. In another thread I was told: “to get its real size, you need to move out the actual binary from the app package and then compress the rest. then sum up the size of the binary + compressed app”. Some searching said the binary is the compressed .app. So then what is the compressed app?

Onto my main question. What makes the app the size it is? It would be useful to know what causes the app to grow so that I can minimise it.

My current project is a 3D arcade game. After some more work, my .app is down to 25.1 MB, 7.9 MB compressed. I’m using the standard iPhone Unity 3 beta 5, so no build stripping. Target Platform is set to arm6 only (otherwise the .app grows to over 40 MB), and Api Compatibility to .NET 2.0 Subset (Unity will not accept 1.1).

For background, my textures total 250 KB (3 256x256 .png atlas textures). I have fonts totalling 279 KB (1 font at 2 sizes). Models total 774KB (7). My Prefabs folder is 381 KB (29). Scripts 143 KB (25), and 3 Scenes totalling 78 KB.

For example, I have 3 atlas textures so that I can use models up to 3 times because I have a different set of suitable images in the same place on all 3. Do I get a benefit from reusing a model? Or do the files include an instance for each time it is used?

Is there any particular coding that will cause the app to grow quickly? For example, all my scripts are 4 KB, except for the main game state file, which is 37 KB. Much of that is taken with the data for the levels, which are called on a switch statement. Does a large switch statement really bloat my app?

I realise this could be a bit vague, but I’m hoping someone will share some examples of what they found enlarged their apps.

the compressed app is the named file in your app package, so if your project is called Sometest, there will be a file sometest in the package with no extension.
Thats the compressed app / binary which will go through uncompressed in the real appstore deploy

I’ve looked all through the folders for my project. The only files I can find without extensions are mostly small (4 KB), or are such things as ‘control’ and ‘strings’ in a ‘strings.pbxstrings’ folder.

The only files I can find with my app name have the extension .app .xcent .LinkFileList and some with .hmap, but apart from the 25.1 MB .app, they are all 4KB.

Is this something that is only generated with a distribution build, and not a release build?

build folder → app → right click and show package content → contents → XXXX

Thank you. I think I have it now.

I started with the 25.1 MB mygame.app. I copied out the 14.9 MB mygame from within mygame.app, then deleted it from mygame.app, making that 10.2 MB, which I compressed down to 2.9 MB. So my app size on the App Store will be about 17.8 MB (14.9 + 2.9).

Is that right? Does Apple DRM have to be added as well to that?

apple DRM adds another bit yes, don’t know its size out of the head, but in case of unity its definitely outweighted by the application part itself

Thank you again.

And the bits I did to find the file size should only be done to a copy (a warning just in case for any else not too sure of what they are doing).