6

I have a Unity3D project that I've already released for iOS via Xcode. Previously the archive size was about 30-40Mb which I'm happy with.

I've now changed a few things within the Unity project, and rebuilt it for Xcode. Now when I archive it, the size is around 110Mb, which is huge compared to the previous file size. I only changed the logo, and splash screen design.

Also, when I rebuild the older version, the size isn't 30-40Mb anymore, it's 110Mb too!

So I'm guessing this is something to do with the new Xcode for iOS8? Not 100% sure, hence why Im asking.

Thanks.

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
Oliver Jones
  • 1,420
  • 7
  • 27
  • 43
  • Are you sure your resources aren't inflating the size? – Ian MacDonald Jan 19 '15 at 21:11
  • That's what I thought, but I haven't changed anything within my resources, only my splash screen – Oliver Jones Jan 20 '15 at 14:07
  • The older Xcode project that archives at around 30-40Mb is roughly the same size as the current Xcode project. Any ideas? – Oliver Jones Jan 20 '15 at 14:23
  • 1
    Take the generated .ipa file and start getting the sizes of the stuff in it. I'd suggest starting with the resources. Maybe @3x image files were added? – picciano Jan 25 '15 at 18:19
  • 2
    I had the same thing after Ios 8 came and updating mu Unity to 4.6. After archiving my game the estimated size looks 300 mb but after I upload it to apple store it is now 60 mb which is normal. [Maybe this post has the answer for this](http://stackoverflow.com/questions/9353859/xcode-4-3s-estimated-app-store-size-is-considerably-different-than-ipa-file) – nexx Jan 26 '15 at 07:41
  • If @nexx comment doesn't solve this, the editor log gives you a detailed overview about every asset after the build has finished. If there is no noteworthy difference there, Xcode is to blame. Otherwise you get an idea what is going on. If very much assets are blown up then check the quality settings. – Kay Jan 26 '15 at 08:23
  • First thought is that this has something to do with architectures you're building for. Maybe you only had one slice when it was 30-40MB and now you have two or three? – Stakenborg Jan 26 '15 at 17:03
  • Just to explain the downvote: I don't think something that can be checked as easily as right-click -> View in Finder belongs on a programming Q&A site. – Filip Radelic Jan 29 '15 at 22:16
  • (Unity app build) Estimated App Store Size: 140.8 MB, size listed in store: 33.4 MB. The splash images alone inside the package add up to 30 megs uncompressed (all my jpegs were converted to pngs). After install, if I go to settings -> general -> usage -> Manage Storage I see the app is 141 MB installed. So maybe Estimated App Store size is the installed size, and not the download size, which is important if you want to stay below the 100 MB wifi only limit. – Scott Driscoll Mar 29 '15 at 13:07

4 Answers4

2

Try to turn off BitCode. Open XCode => Build Settings => search Enable BitCode. Set it to No.

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Leo Nguyen
  • 614
  • 1
  • 9
  • 23
1

Have you read this? http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

Also it can be fault of stripping level, try to use micro mscorlib.

In addition you can take a look at Decrease Your App’s Code Size from Mac App Programming Guide. https://developer.apple.com/library/mac/documentation/General/Conceptual/MOSXAppProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40010543-CH9-SW2

1

I believe part of what is happening here is the additional overhead for the arm64 slice (unless you were already including the arm64 slice previously). I would not expect that much of an increase in size for the arm64, but it would still be roughly X2 on the app binary (minus the resources).

As of Feb 1, Apple requires arm64 support as well as the app being built with the iOS 8 SDK. The default Xcode build setting enables arm64.

What you can do is Show Package Contents on the xarchive and work your way to the app executable binary. You can then compare the size difference on the app executable binary from before and now. You can also run lipo -info on it to see all the slices from before and now. Note I am assuming you have an older xarchive to compare with.

I would then probably diff the rest of the resources (use something like Araxis merge) to see the differences in the files. This will let you see what resource files changed or got added. If your diff is only the executable, then you have isolated were the size difference has come from.

Mobile Ben
  • 7,121
  • 1
  • 27
  • 43
0

The 'Estimated App Store Size' reflects the installed app size, not the download size.

I'm basing this off the following test:

(Unity app build) Estimated App Store Size: 140.8 MB, size listed in store: 33.4 MB. The splash images alone inside the package add up to 30 megs uncompressed (all my jpegs were converted to pngs) so there's no way the installed size is 33.4 MB. After install, if I go to settings -> general -> usage -> Manage Storage I see the app is 141 MB installed.

I'm not sure how to estimate the download size, which is what matters if you have an app you want to be downloaded over cellular network and needs to be under 100 MB downloaded.

I added this as a comment to the question, but I wish I had read this as an answer, so here it is.

Scott Driscoll
  • 2,869
  • 2
  • 23
  • 22