Unity/iOS : Podsの中のFyberのIASDKCoreをビルド時に自動追加

using UnityEditor.iOS.Xcode;
using UnityEditor.iOS.Xcode.Extensions;

.
.
.

[PostProcessBuildAttribute(10)]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path) {
        if (buildTarget != BuildTarget.iOS)
        {
                return;
        }
        string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
        PBXProject proj = new PBXProject();
        proj.ReadFromFile(projPath);
        string mainTarget = proj.GetUnityMainTargetGuid();
        string frameworkTarget = proj.GetUnityFrameworkTargetGuid();
	var src = Path.Combine("Pods", "Fyber_Marketplace_SDK", "IASDKCore", "IASDKCore.xcframework");
	var frameworkPath = proj.AddFile(src, src);
	proj.AddFileToEmbedFrameworks(mainTarget, frameworkPath);
	proj.WriteToFile(projPath);
}

Unity/iOS : Podsの中のFyberのIASDKCoreをビルド時に自動追加
トップへ戻る