Empty Unity Project Size Too Big (39 MB)

Hello! I am in the process of creating my first iPhone/Pad app with Unity, and it seems one of the important things to check is the size of the app (under 20 mb for wifi downloading).

I found this info on Unity’s website:

And I have found some helpful formulas on other forum posts (http://forum.unity3d.com/threads/40575-Game-size-CHECK-under-10mb)

However, the empty project I created and deployed to the iPad (it only has a main scene with a main camera) was about 39 MB. I create the project, build within Unity, then open the project in Xcode. From there I build the project, and that creates a build folder within the folder that was created from Unity. Inside that folder is an Application file, and that file is 39 MB.

If I am understanding everything correctly, that Application file is still only one step of determining an app’s final size (that piece along with any zipped assets/scripts, plus Apple’s DRM). However, given that the empty application is 39 MB, I must be doing something wrong…especially since, according to Unity, an empty project WITH Apple’s DRM should only be 13 MB.

Could anyone point out what I might be doing incorrectly? I only have the Unity iPhone basic license (so no build stripping) but it seems that is what Unity states should still be 13 MB empty.

Thanks!

  • Joe

You have a universal build, targetting ARM6 + Arm7 together. Essentially two copies of your game in one binary. Go to Build Settings in Unity, click player settings, and target one architecture or the other. :slight_smile:

In addition to that:

  1. use .NET 2.0 subset
  2. don’t use javascript Arrays
  3. don’t use .NET classes that are outside mscorlib.

Wifi downloading is available for any size. The only time < 20MB is a concern is if you want over-the-air downloading, but in my experience I’d recommend not killing yourself trying to do this. There are other, more important factors, than that.

–Eric

I did make another post a while ago, but I guess it wasn’t approved. I’ll try again:

The arm6 + arm7 was a big fix! When I targeted just arm6, an empty project went down to 22.3 MB (originally 39 MB with both arm6 and arm7). But this is still much higher than what Unity claims an empty project to be. Can other people successfully create an empty project that is as small as advertised? I’m not sure what I’m doing wrong.

The empty project is using .net 2.0 subset and there are no scripts, just the main camera.

Are there any other settings/tricks required to shrink the size of a project?

EDIT: It also occurs to me that maybe I’m doing something wrong in Xcode. I’m using Xcode 4.0.2 and am simply building to the iPad. Perhaps there is some setting somewhere in Xcode that changes the size of an app?

Thanks,
Joe

What is the best work around for this if coding in javascript? (sorry I am new)

import System.Collections.Generic;

private var someIntArray : List.<int>;

function Start () {
    someIntArray = new List.<int>();
    someIntArray.Add(5);
    print (someIntArray.Count);
}

–Eric

Yes, Xcode 4.x behaves slightly different. By default if you do “Product”->“Build” it builds debug version, which is 5-7 MB bigger than release version. If you want to check how big will be release version you should go for “Product”->“Build For”->“Build For Archiving”.

Thanks mantasp! I think I finally have all the pieces of the puzzle now… Also linking another post (http://forum.unity3d.com/threads/69330-Game-size-issues) because it is also required to fully understand everything.

So, with the changes to Xcode that mantasp suggest, the application size is 17.4 MB – still a little larger than the ~13 MB that the docs claim. However, in the linked post, Moonjump describes the process one step further. Instead of just taking the 17.4 MB at face value, you right-click the app and show the contents of the package and remove the unix executable (in an empty project this is a mere 11.7 MB). After this, you compress the remainder of the contents in the app file (an empty project compresses down to 1.7 MB). Add those two things together, and you get 13.4 MB!

I’m still a LITTLE skeptical because the Unity docs claim that the size should be about 13 MB on the app store (and from other posts I’ve seen, it sounds like Apple’s DRM takes up about 4.5 MB). But, maybe because there are no scripts in an empty project, the DRM is super small? Or maybe the Unity docs don’t take into account the DRM?

Mantasp (or any of the Unity gurus out there) - does all this information make sense? Hopefully this helps someone else out there too…it’s nice to have all the info in one place =)

Thanks everyone!

  • Joe