Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unity iPhone app size is too big

Tags:

unity3d

I built a unity game for iPhone which gave an app size of 288 MB. So tried with an empty unity project. Initially it generated app of size 33 MB. But after googling i could reduce it to 19.2 MB.

The changes i made: 1. Release build instead of debug build. 2. Target Device: only iPhone(in Unity settings). 3. Target Platform: armv7

The device log from unity showed:

Mono dependencies included in the build
mscorlib.dll

Textures 0.0 kb 0.0%
Meshes 0.0 kb 0.0%
Animations 0.0 kb 0.0%
Sounds 0.0 kb 0.0%
Shaders 0.0 kb 0.0%
Other Assets 0.0 kb 0.0%
Levels 6.7 kb 0.3%
Scripts 0.0 kb 0.0%
Included DLLs 2.4 mb 99.4%
File headers 8.0 kb 0.3%
Complete size 2.4 mb 100.0%

The package contents of my app has the unix executable with size 13.3 MB and Data 5.7 MB.

Is there any thing i must change in unity settings or Xcode to reduce the app size further? Please help me.

like image 717
techgentsia Avatar asked May 08 '12 06:05

techgentsia


1 Answers

If you have the Unity Pro iPhone Pro license you could change the stripping level to use micro mscorlib. Read Optimizing the Size of the Built iOS Player for more information.

In XCode the GCC 4.2 Code Generation / Optimisation Level should be Fastest, Smallest (-Os) - Unity3d will do that for your release builds in general.

Another point of interest are textures, audio and other resources. If you don't need iPad resolution you might be able to reduce the size of your images. Check that all your images comply with the POT rule (Power Of Two) i.e. 128x128, 256x256, ... so that Unity3D can use PVRTC hardware compression for building iOS player. Non POT images will end up as uncompressed true color images.

like image 149
Kay Avatar answered Oct 01 '22 19:10

Kay