pbxProject=newPBXProject(); pbxProject.ReadFromString(File.ReadAllText(pbxProjectPath)); mainTarget= pbxProject.GetUnityMainTargetGuid();//这个对应target中的Unity-iPhoneframeworkTarget = pbxProject.GetUnityFrameworkTargetGuid();//这个对应target中UnityFrameworkstring plistPath= xcodeProjectPath +"/Info.plist"...
PBXProject.AddFile public string AddFile (string path, string projectPath, iOS.Xcode.PBXSourceTree sourceTree); パラメーター path The physical path to the file on the filesystem. projectPath The project path to the file. sourceTree The source tree the path is relative to. By default it...
pbxProject.AddFileToBuild(targetGuid, bun);//修改Info.plist文件 SetInfoPlist(buildPath);File.WriteAllText(pbxProjPath, pbxProject.WriteToString());UnityEngine.Debug.Log("PBXProject : --->" + pbxProject.WriteToString()); }public static void SetInfoPlist(string buildPath) {...
PBXProject.AddFileToBuildWithFlags public void AddFileToBuildWithFlags (string targetGuid, string fileGuid, string compileFlags); 参数 targetGuid TargetGuidByName 返回的目标的 GUID。 fileGuid AddFile 或 AddFolderReference 返回的文件 GUID。 compileFlags 要使用的编译标志。 描述 将文件配置为针对具有特...
PBXProject _pbxProj = new PBXProject (); _pbxProj.ReadFromString (File.ReadAllText (_projPath)); 3、获取targetGUID string _targetGuid = _pbxProj.TargetGuidByName ("Unity-iPhone"); 4、在做好这些准备之后,我们就能够添加一些想要的framework,方法也很简单,使用AddFrameworkToProject方法。
string fileGuid = proj.AddFile(framework, "/" + coreFrameworkName, PBXSourceTree.Source); PBXProjectExtensions.AddFileToEmbedFrameworks(proj, target, fileGuid); // Write proj File.WriteAllText(projPath, proj.WriteToString()); // Add permission ...
PBXProject proj = new PBXProject();//new()一个PBXProject对象,然后从上面获取的路径中读出字符串。 string contents = File.ReadAllText(projPath); proj.ReadFromString(contents); string target = proj.TargetGuidByName(PBXProject.GetUnityTargetName());//获取targetGUID ...
AddFileToBuild(targetGuid, fileGuid); } 拷贝文件夹,代码文件如.h/.m等文件会自动拷贝的Xcode工程中,但图片,三方的Framework、lib等文件并不会自动拷贝到Xcode工程中,所以需要cs脚本来完成 代码语言:javascript 代码运行次数:0 运行 AI代码解释 private static void FilesAdd(PBXProject project, string mTargetGUID...
PBXProject proj = new PBXProject(); proj.ReadFromFile(projPath); // 添加AppTrackingTransparency.framework string target = proj.GetUnityFrameworkTargetGuid(); proj.AddFrameworkToProject(target, "AppTrackingTransparency.framework", false); // 添加前面的两个ObjectC文件 ...
PBXProject pbxProject = new PBXProject():创建一个新的PBXProject实例。 pbxProject.ReadFromString(File.ReadAllText(projectPath)):从Xcode项目配置文件中读取数据。 string targetGuid = pbxProject.GetUnityFrameworkTargetGuid():获取Unity Framework的目标GUID。 pbxProject.AddFileToBuild(targetGuid, pbxProject.AddFile(...