Unity Xcode API设置DevelopmentTeam
2017-01-09 本文已影响443人
2b75747cf703
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");