Unity Xcode API设置DevelopmentTeam

作者: 2b75747cf703 | 来源:发表于2017-01-09 16:00 被阅读443次
            var pbxProject = new PBXProject();
            pbxProject.ReadFromFile("project.pbxproj");

            var pbxProjectData = pbxProject.GetFieldValue("m_Data");

            var project = pbxProjectData.GetFieldValue("project").GetPropertyValue("project");

            var properties = pbxProjectData.GetFieldValue("project").GetPropertyValue("project").GetFieldValue("m_Properties") as PBXElementDict;

            var targetGuid = pbxProject.TargetGuidByName("Unity-iPhone");

            var targetAttributes = properties["attributes"]["TargetAttributes"][targetGuid];
            if (targetAttributes == null)
                targetAttributes = properties["attributes"]["TargetAttributes"].AsDict().CreateDict(targetGuid);

            targetAttributes.AsDict().SetString("DevelopmentTeam", "AMSTN4PRF9");
            targetAttributes.AsDict().SetString("ProvisioningStyle", "Automatic");

            pbxProject.WriteToFile("project.pbxproj");

相关文章

网友评论

    本文标题:Unity Xcode API设置DevelopmentTeam

    本文链接:https://www.haomeiwen.com/subject/drrhbttx.html