LoginSignup
28
27

More than 5 years have passed since last update.

UnityのXcodeApiでBitCodeをNOにする

Posted at

Xcode7が勝手にインストールされ、
UnityでiOSのビルドをするときにBitCode絡みでエラーが出るなら、
やはりスクリプトで自動的にBitCodeEnableをNOにしたいよね、という時の話。

PostprocessBuildPlayer
public class PostprocessBuildPlayer : MonoBehaviour
{
    [PostProcessBuild]
    public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
    {
        if (buildTarget == BuildTarget.iOS) {
            string projPath = PBXProject.GetPBXProjectPath (path);
            PBXProject proj = new PBXProject ();
            proj.ReadFromString (File.ReadAllText (projPath));
            string target = proj.TargetGuidByName ("Unity-iPhone");

            // これでBitCodeEnableをNOに
            proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO");

            File.WriteAllText(projPath, proj.WriteToString());
        }
    }
}

というだけの備忘録

28
27
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
27