Optimize game size for iOS

Can anyone direct me to some documentation about steps to take to make Unreal iOS games as small as possible?

I just downloaded Unreal 4.9 for evaluation at our company. I created a “Basic Code” C++ project, got it running on my iPad. But when I package it for shipping the size is 116 MB. How can I strip that down to less than 30MB. I tried reading the docs but no info there. I disabled the Slate plugin. My Content Browser says I have no assets, the only thing there is single map that has one floor.

Best, Hu

I would also like the answer to this.
I’ve tried to do the stuff mentioned in the question here.

However these are already implemented or do not work.

The compiled binary by itself is more than 100mb. (which seems excessive)

How would we go about trimming the fat? (i.e. stop junk libraries being linked?)

Just disabling plugins makes no difference. (and then recompiling afterwards as well)

EDIT: I should mention we’re also using 4.9

Yeah, I been trying to find that Tappy Chicken project but I can’t find it in the Store as said in the blog. I’d love to check how that project got it down to 33MB. It would be sad if the evaluation of Unreal would fall short here.

So I’ve continued digging and come across the following info here.

By default ARMv7, ARMv7s and ARM64 support are built into the binary which triples the size of the binary. So killing ARMv7s support saves you ~35mb.

Since Tappy Chicken was released, the app store now requires that you provide ARM64 support, so you either need to support x64 and 32 bit devices or ONLY x64 devices. (Which doubles the original 33MB if you want to support both)

I would still like to know if it is still possible to trim off more fat, (i.e. excess libaries) but with killing ARMv7s it drops the ipa size low enough that we should be able to make do with the 100mb Cellular data limit.

NOTE: The tappy chicken example should be under ‘Learn’ in the launcher rather than the store.

EDIT: I’ve also noticed a bunch of extra cruft gets cooked into the package (for example: Engine/Content/EngineDebugMaterials sitting at 11mb uncompressed) I’d like to kill this stuff as well.

More EDIT: This question has more of the same info. (on the accepted answer) It might be a good idea to follow that question as well.

Cheers, I found the Tappy chicken project. I have a clean Unreal 4.9.2 installation. I loaded the TappyChicken project, changed the build configuration to “shipping” and packaged it for iOS. The IPA I get is 113MB, does anyone know if this is expected size or is there a bug somewhere in the packaging scripts. Best regards, Hu.

If you are not using the Github version of the engine, then that is the expected size.
As I mentioned in my answer above, it is built for the 3 architectures supported by UE4 which triples the binary size.
If you open the final .ipa with 7zip, you should see the ‘YourAppName’ file (the executable) and it should be sitting around the 110mb mark.

So to fix that, you’re going to need to get the Github version, and in the editor under ''Project Settings" in the “iOS” section, uncheck “build ARMv7s for shipping” and then package for iOS.
This should (hopefully) cause the binary to be re-built and should be much smaller.

Due to the changes to app requirements on iOS, your executable alone will be ~80mb if you want to support devices older than the 5s. If that’s not an issue, then your binary should be close to to 40mb mark once you uncheck the “build ARMv7 for shipping” as well.

Since the blogpost, UE4 has gone through multiple versions (which added a bunch of features) and the appstore submission requirements have changed. Don’t expect to get the 33mb mentioned as it’s now outdated.

After some more searching, I also found these in the TappyChicken example project. Specifically in: UE4Root\TappyChicken\Config\IOS\IOSEngine.ini

[/Script/BuildSettings.BuildSettings]
  bCompileLeanAndMeanUE=True
  bCompileForSize=True
  bCompilePhysX=True
  bCompileAPEX=False
  bRuntimePhysicsCooking=True
  bCompileBox2D=False
  bCompileICU=False
  bCompileSimplygon=False
  bIncludeADO=False
  bCompileRecast=False
  bCompileSpeedTree=False
  bCompilePhysXVehicle=False
  bCompileFreeType=True
  bCompileCEF3=False

Depending on the features you plan on using on mobile, this will significantly cut down the size of the executable. As of now it’s sitting at around the 57mb mark.

Do note however that you need to be using the Github version of the engine, as these are used at compile time to remove extra un-needed libaries.

More detail for what each variable does can be found in the comments at: UE4Root\Engine\Source\Programs\UnrealBuildTool\Configuration\UEBuildConfiguration.cs

The documentation on this is quite poor either way. It’s out of date, and lacking any real useful info.
I hope Epic has plans to fix it in the future.

Anyway, hope that helps. :slight_smile:

EDIT: should mention that the flags will be different for you depending on what features you plan on using.

Be aware that if you plan to submit arm64 only, you can only target iOS 9, and you need to modify your Info.plist key “UIRequiredDeviceCapabilities”, to contain “arm64”, but not “armv7”, and since the engine currently (4.9, 4.10 preview 4) don’t support iOS 9 (no UI option for it), you’ll have to do some modifications to get there. iOS Keys

Large APK

Just don’t use ue4