Created
March 3, 2023 17:38
-
-
Save murapong/446c4966b1666f62bf8185dcd25e9076 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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