1

I have been going through different posts regarding Bit Code option introduced in XCode. As i am creating a project in unity trying to reduce the over the air build size. According to most of the bit code post related to unity they ending up disabling it. my questions are

  • If i enable the bit code for unity project i know the addition bit code data will be stripped but does it will decrease the orignal size of Over-the-air build as right now i have an estimate universal Download size is 125 MB and i want it to be less then 100MB?
  • Can i disable the bit code for a specific framework but enable for project?

Unity Version : 5.3.5f1t XCode : 7.2

Thanks

1 Answers1

3

As stated here , bit code is specifically for App Store submission. And extra data will be stripped by App Store only. So I guess in all other cases like ad-hoc/OTA it will not reduce build size.

For your other question, you can use PostProcessing to change these settings.

Here is an example:

using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
using UnityEditor.iOS.Xcode;
using System.IO;

public class BL_BuildPostProcess
{

    [PostProcessBuild]
    public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
    {

        if (buildTarget == BuildTarget.iOS)
        {
            string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";

            PBXProject proj = new PBXProject();
            proj.ReadFromString(File.ReadAllText(projPath));

            string target = proj.TargetGuidByName("Unity-iPhone");

            proj.SetBuildProperty(target, "ENABLE_BITCODE", "false");

            File.WriteAllText(projPath, proj.WriteToString());
        }
    }
}

Other references:

IL2CPP Build Size Optimizations

Bitcode Support In IOS & TvOS

hope it helps :)

Umair M
  • 10,298
  • 6
  • 42
  • 74