2

I want to be able to change the Team used for code signing an iOS target at build time, using a configuration, build variable or similar mechanism. As far as I can tell, the only way to access the Team setting is via the dropdown in the target's "General" configuration tab, and it is stored in the project file. Right now, I have created a second target with another team set, which is a lot of duplicated settings to just change this one parameter.

Is there a more flexible way to control the Team setting?

jbelkins
  • 470
  • 3
  • 15

1 Answers1

5

You can achieve this using shell scripting by changing the DevelopmentTeam variable in your .pbxproj file. Simply fetch the current team using -

awk -F '=' '/DevelopmentTeam/ {print $2; exit}' project.pbxproj

Replace that using sed with your new development team replacing its 10-digit certificate id.

sed -i '' 's/old_team_cert_id/new_team_cert_id/g' project.pbxproj

Sarthak Singhal
  • 665
  • 2
  • 10
  • 26