Greetings,
I need to disable bitcode in an iOS build because a plugin I use does not support it.
I added the following script to an Editor folder in my project to disable bitcode but the plugin isn’t working with the latest build and I can’t tell from the build logs whether or not Cloud Build honored the script and disabled bitcode. I’m using Unity 2020.1.6f1. Should the below script work to disable bitcode and if so, how can I tell if bitcode was actually disabled in the build?
#if UNITY_IOS
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
public static class PostBuildScript
{
[PostProcessBuild(1000)]
public static void PostProcessBuildAttribute(BuildTarget target, string pathToBuildProject)
{
if (target == BuildTarget.iOS)
{
string projectPath = PBXProject.GetPBXProjectPath(pathToBuildProject);
PBXProject pbxProject = new PBXProject();
pbxProject.ReadFromFile(projectPath);
string[] targetGuids = new string[2] { pbxProject.GetUnityMainTargetGuid(), pbxProject.GetUnityFrameworkTargetGuid() };
pbxProject.SetBuildProperty(targetGuids, "ENABLE_BITCODE", "NO");
pbxProject.WriteToFile(projectPath);
}
}
}
#endif
Thanks!