com.guru.unity.max/Amazon/Scripts/Editor/AmazonPostBuildiOS.cs

30 lines
1.0 KiB
C#
Raw Normal View History

2023-12-26 03:47:44 +00:00
#if UNITY_IOS
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEngine;
namespace AmazonInternal.Editor.Postbuild {
public static class AmazonPostBuildiOS {
2024-06-24 01:28:57 +00:00
[PostProcessBuildAttribute(1)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
2023-12-26 03:47:44 +00:00
if (buildTarget != BuildTarget.iOS)
return;
2024-06-24 01:28:57 +00:00
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
2023-12-26 03:47:44 +00:00
string pbxProjectPath = PBXProject.GetPBXProjectPath(path);
2024-06-24 01:28:57 +00:00
PBXProject pbxProject = new PBXProject();
2023-12-26 03:47:44 +00:00
2024-06-24 01:28:57 +00:00
pbxProject.ReadFromFile(pbxProjectPath);
2023-12-26 03:47:44 +00:00
2024-06-24 01:28:57 +00:00
string[] targetGuids = new string[2] {
pbxProject.GetUnityMainTargetGuid(),
pbxProject.GetUnityFrameworkTargetGuid()
};
pbxProject.SetBuildProperty(targetGuids, "ENABLE_BITCODE", "NO");
2023-12-26 03:47:44 +00:00
2024-06-24 01:28:57 +00:00
pbxProject.WriteToFile(pbxProjectPath);
}
2023-12-26 03:47:44 +00:00
}
}
#endif