public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject) { if (target != BuildTarget.iPhone) { Debug.LogWarning("Target is not iPhone. XCodePostProcess will not run"); return; } // Create a new project object from build target XCProject_AutoPack project = new XCProject_AutoPack(pathToBuiltProject); // Find and run through all projmods files to patch the project. // Please pay attention that ALL projmods files in your project folder will be excuted! string[] files = Directory.GetFiles(Application.dataPath, "*.projmods", SearchOption.AllDirectories); foreach (string file in files) { UnityEngine.Debug.Log("ProjMod File: " + file); project.ApplyMod(file); } //TODO implement generic settings as a module option project.overwriteBuildSetting("CODE_SIGN_IDENTITY[sdk=iphoneos*]", "iPhone Distribution", "Release"); // Finally save the xcode project project.Save(); }
//创建Xcode的工程 static XCProject_AutoPack createXProj(string pathToBuiltProject) { // Create a new project object from build target XCProject_AutoPack project = new XCProject_AutoPack(pathToBuiltProject); // Find and run through all projmods files to patch the project. // Please pay attention that ALL projmods files in your project folder will be excuted! //在这里面把frameworks添加在你的xcode工程里面 string[] files = Directory.GetFiles(Application.dataPath, "*.projmods", SearchOption.AllDirectories); foreach (string file in files) { project.ApplyMod(file); } //添加provisioning project.overwriteBuildSetting("PROVISIONING_PROFILE", "DisYingYou"); //设置签名的证书, 第二个参数 你可以设置成你的证书 project.overwriteBuildSetting("CODE_SIGN_IDENTITY", "iPhone Distribution: Shanghai Shadow Game Network Science and Technology Co., Ltd.", "Release"); project.overwriteBuildSetting("CODE_SIGN_IDENTITY", "iPhone Distribution: Shanghai Shadow Game Network Science and Technology Co., Ltd.", "Debug"); return(project); }