10

I have an XCode project with multiple target that compiles some shared source code file, in addition to specific .xib files. Basically each target builds a different app, but under the hood, most of the code is shared.

I would like a way to automate the deployement of these apps. Currently, I need to select the target in the scheme drop down, select Product > Archive, click share, select the appropriate code signing certificate and a location, then deploy my .ipa.

I think I need to use an Aggregate that builds all my targets and use xcrun as seen in this question on StackOverflow as a script run in the build phase of each target, but I'm blocked at the code signing part. I found the CODE_SIGN_IDENTITY in the Build Setting section of the Xcode Build Setting Reference. How can I programmatically access the Provisioning Profile specified in each target's Build Settings ?

I guess a last resort would be to store the profiles in a know directory relative to my source code path

Community
  • 1
  • 1
Thomas Joulin
  • 6,590
  • 9
  • 53
  • 88

1 Answers1

0

To access it from a script / from the CLI just pass the name you get from the CODE_SIGN_IDENTY to the codesign program :)

e.g.: sign='codesign -s "$CODE_SIGN_IDENTY" "$PATH_TO_APP"'


to do it programmatically via Objective C use the KeyChain API to find the item named CODE_SIGN_IDENTY. This is what the code sign CLI app does as well

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135