skip to Main Content

I’m trying to build Unity project in Xcode, it is a simple 2D project of games like Crossword,Trivia, MCQ questions… when i archive and download from Testflight the game is 2GB in size, any idea what to do or why is it so big ?

2

Answers


  1. Chosen as BEST ANSWER

    as @MickyD explained a lot of stuff that would help, however the problem was with the assets "sprites" imported were too big, so since I had like 3k sprites, i couldn't re-import each one of them as a POT so I compressed them inside Unity by overriding for IOS

    • Max Size : 512
    • Format : RGB(A) compressed ASTC 4x4 blocks

    and if the sprite lost a lot of quality I would increase the size to 2048 or try another format.



  2. NOTE: Avoid using LZMA compression since Asset Bundles "…results in smaller compressed Asset Bundles but they must be entirely decompressed before use.", Unity.


    Sizing

    Accurate size?

    when i archive and download from Testflight the game is 2GB in size, any idea what to do or why is it so big ?

    You can’t just look at the archive/bundle or files downloaded from TestFlight as a means to determine the app’s size because the binaries produced during these development/testing scenarios include additional files (e.g. DSYM) that won’t be present in it’s final form thus skewing the results.1

    Apple has this to say on the subject (my emphasis):

    During development, the only way to get accurate download and installation sizes for your app is to create an app size report on your Mac. However, if your app is available through the App Store or the TestFlight app, App Store Connect provides the most accurate size information. It displays the size for each variant of your app and warns you if it exceeds the limit for downloading over a mobile internet connection.1

    Also don’t worry too much about TestFlight as builds are still going to be larger than what appears in the AppStore.1

    Apps distributed for testing with TestFlight contain additional data that an App Store build doesn’t have, so the TestFlight build is larger. This additional data isn’t included in your app when you make it available in the App Store. 1

    Additionally, assuming you app gets approved, Apple will modify your submission including adding DRM and re-compressing everything. So you might have to wait to see the final size.1

    However, when compared to the binary you uploaded, the final size of your app after it’s approved for the App Store may end up being slightly larger. This size increase can happen when the App Store performs additional processing on your app’s binaries, adding DRM to prevent app piracy and then re-compressing the binaries.1

    How to get more accurate size information?

    I think the best approach is to produce a App Size Report. Apple’s website has instructions for creating the most accurate file size report for download and installation sizes.2

    Here’s an example (courtesy Apple):2

    App Thinning Size Report for All Variants of ExampleApp
    
    Variant: ExampleApp.ipa
    Supported variant descriptors: [device: iPhone11,4, os-version: 12.0], [device: iPhone9,4, os-version: 12.0], [device: iPhone10,3, os-version: 12.0], [device: iPhone11,6, os-version: 12.0], [device: iPhone10,6, os-version: 12.0], [device: iPhone9,2, os-version: 12.0], [device: iPhone10,5, os-version: 12.0], [device: iPhone11,2, os-version: 12.0], and [device: iPhone10,2, os-version: 12.0]
    App + On Demand Resources size: 6.7 MB compressed, 18.6 MB uncompressed
    App size: 6.7 MB compressed, 18.6 MB uncompressed
    On Demand Resources size: Zero KB compressed, Zero KB uncompressed
    
    // Other Variants of Your App.
    

    OP:

    compressed almost 70 MB uncompressed 2 GB , I changed compression method in unity build to LZ4 and the app reduced to 180 MB

    As above, development/testing outputs are not indicative of the final size on the Apple Store.

    Unity folder size

    OP:

    …also my Unity project folder is 3.3 GB in total , with 2.6 GB for Library/Artifacts.

    By "project folder", I’m assuming you mean your project’s top-level folder in which Unity folders such as Assets, Packages and ProjectSettings exist. In any event, getting the size of the Unity project folder isn’t helpful for essentially the same reasons – it contains files that:

    a) aren’t necessarily deployed

    b) may be temporary (Logs)

    c) for Unity-use-only such as caching (Library)

    The easiest way to get the size of your Unity project is to get the size of the Assets, Packages and ProjectSettings folders and the best time to do that is when performing a fresh check-out of your project from source control.

    enter image description here

    Remember, only the folders highlighted in green above should be added to source control and therefore are the candidates for determining your Unity project size.3

    Trimming the fat

    Chose a better compression option in Unity. This will compress assets, scenes and global illumination data.

    For PROD you should be using LZ4HC which offers the best compression but is slower to build.

    LZ4 is the next best compression and is faster to produce making it suitable for DEV builds.

    The Default option in Unity doesn’t use any form of compression.

    Check out App Thinning on Unity’s website. Since it’s a large topic, I can’t really do it justice by reproducing it here.


    1 "Reducing Your App’s Size", Apple

    2 Create the App Size Report

    3 Using external version control systems with Unity, Unity

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search