Skip to content

Instantly share code, notes, and snippets.

@murapong
Created March 3, 2023 17:38
Show Gist options
  • Save murapong/446c4966b1666f62bf8185dcd25e9076 to your computer and use it in GitHub Desktop.
Save murapong/446c4966b1666f62bf8185dcd25e9076 to your computer and use it in GitHub Desktop.
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public class DisableBitCodeBuildProcessor
{
[PostProcessBuild(0)]
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
{
if (buildTarget != BuildTarget.iOS) return;
var projectPath = PBXProject.GetPBXProjectPath(buildPath);
var project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
var targetGuid = project.GetUnityFrameworkTargetGuid();
project.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
File.WriteAllText(projectPath, project.WriteToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment