Search Unity

Help with minimizing the size of iOS (IL2CPP) builds

Discussion in 'iOS and tvOS' started by jlhacode, Nov 6, 2020.

  1. jlhacode

    jlhacode

    Joined:
    Feb 20, 2020
    Posts:
    13
    Hey all, I’m having a bit of trouble minimizing the size of my iOS build.

    Here's the Editor Log build result: Link

    There seems to be some fuzzy math going on. The build report from the editor log doesn’t exactly add up. Given the values above, my “Complete build size” is 598.9mb (5 9 8 . 9!!!!)

    I figured, okay, maybe there’s a setting or something that I have to play with… so I decided to go to our trusty friend YouTube.

    After watching this talk: youtube.com/watch?v=4JLpJHIdx7E, I did a profile of my build. Link

    And it turns out that Unity Player static library is the main culprit.

    Well, I have no idea what Unity Player static library is, and I don’t really know the purpose of libiPhone-lib.a, so I went hunting for answers on Google with queries like these:

    “Unity Player static library”
    “Unity Player static library” big
    “Unity Player static library” large
    “Unity Player static library” reduce
    “libiPhone-lib.a” “libiPhone-lib.a” large
    “libiPhone-lib.a” reduce
    etc.

    After 5 hours, and some internal crying, I’m ashamed to say that I’ve made no real progress. Well actually, maybe I lied. I did find out that my game shows up on my iPhone as 381mb with bitcode enabled, and 370mb without, but that’s about it.

    I built an empty Unity iOS project, and that came out to 28.7mb, so that checks out. My Android install (using sweet. sweet. Mono) shows up as 101mb on my Android device.

    If anyone can shed some light on this, I would greatly appreciate it.