16

Yet another code sign error.

I'm running command:

xcodebuild -project $DIR/myproject.xcodeproj -sdk iphoneos5.0 -alltargets

and my project.pbxproj

"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Ryan"
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "/Users/ryan/12345678-9012-3456-7890-123456789012.mobileprovision";

with output

=== BUILD NATIVE TARGET myproject OF PROJECT myproject WITH THE DEFAULT CONFIGURATION (Release) ===
Check dependencies
[BEROR]Code Sign error: Provisioning profile '/Users/ryan/12345678-9012-3456-7890-123456789012.mobileprovision' can't be found

I can't find any guidance on how to do this. Ive tried putting the provision in ~/Library/MobileDevice/Provisioning Profiles and setting the profile field in project.pbxproj to just the profile ID

It is a requirement that I need to be configure this at the command line w/o Jenkins/Hudson

Ryan
  • 865
  • 2
  • 10
  • 17

1 Answers1

20

Provisioning file goes to ~/Library/MobileDevice/Provisioning Profiles and you you can select the provisioning profile like this:

xcodebuild PROVISIONING_PROFILE=12345678-9012-3456-7890-123456789012
jarnoh
  • 485
  • 4
  • 4
  • This is a much better way of doing it. All the build flags that can be used are here: [https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html](https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html) – Ryan May 31 '12 at 18:55
  • 1
    My provisioning profiles are in another user directory and jenkins run with a different user. Should I create the MobileDevices directory? – Claus Nov 08 '12 at 19:05
  • 2
    @Claus xcodebuild will look for the Provisioning files in that directory only. So you will need to copy them to ~/Library/MobileDevice/Provisioning Profiles – Ryan Nov 19 '12 at 11:40
  • 3
    If you have a provisioning file and want to get its id you can use: `/usr/libexec/PlistBuddy -c 'Print UUID' /dev/stdin <<< $(security cms -D -i ${WORKSPACE}/FILE.mobileprovision)` – suda Feb 11 '15 at 16:27