How do I add certificates for OS X Server 3.2.1 with Xcode 6.0.1

后端 未结 7 1667
遇见更好的自我
遇见更好的自我 2020-12-25 08:58

After I have upgraded both Xcode (to 6.0.1) and OS X Server (to 3.2.1) I can\'t figure out how to add certificates for the provisioning profiles so the Xcode bot can find th

7条回答
  •  旧时难觅i
    2020-12-25 09:13

    Try to add your server to the developer portal first and remove all restrictions like explicit provisioning files from your project.

    If this doesn't work, file a Radar explaining your configuration and why you think it should be supported by Apple.

    If you are really, really sure it's a good idea to hack your server, possible breaking it, open a terminal on your server from an account with administrator privileges and:

    1. Copy the Portal keychain to your desktop:

      > sudo cp /Library/Developer/XcodeServer/Keychains/Portal.keychain ~/Desktop/
      

      Password: your-administrator-password

      > sudo chown `whoami`:staff ~/Desktop/Portal.keychain 
      
    2. Set the Portal keychain password to “123”

      > security set-keychain-password -o "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain 
      

      New Password: 123

      Retype New Password: 123

    3. Open the Keychain in Keychain Access:

      > open -b com.apple.keychainaccess ~/Desktop/Portal.keychain
      
    4. Unlock the “Portal” keychain using password “123

    5. Copy the needed keys from your personal “login” keychain to the “Portal” keychain.

    6. Make sure the private keys have the right access rights (in the “Access Control” tab), “xcsbuildd”, “xcscontrol”, “xcodebuild” and “codesign” should be listed

    7. Lock the “Portal” keychain, quit “Keychain Access”

    8. Reset the Portal keychain password:

      > security set-keychain-password -p "`sudo cat /Library/Developer/XcodeServer/SharedSecrets/PortalKeychainSharedSecret`" ~/Desktop/Portal.keychain 
      

      Password: your-administrator-password (optional step)

      Old Password: 123

      It may or may not ask you for your administrator password again, pay attention to the prompt.

    9. Copy the Portal keychain back

      > sudo chown _xcsbuildd:_xcs ~/Desktop/Portal.keychain
      > sudo cp ~/Desktop/Portal.keychain /Library/Developer/XcodeServer/Keychains/
      
    10. Since the system caches open keychains, restart you computer.

    Don't just blindly copy keys to the Portal keychain. Try other solutions first and ask on stack overflow if you need help. Only follow this procedure after filing a Radar, not just because “things don't work”. You will destroy your system when you are not exactly sure what you're doing here.


    Alternate procedure (for the advanced):

    Copy the following script as importP12.sh:

    #!/bin/sh
    
    importP12()
    {
    P12FILE="$1"
    XCS="/Library/Developer/XcodeServer";
    XCBIN="$XCS/CurrentXcodeSymlink/Contents/Developer/usr/bin";
    PORTALKC="$XCS/Keychains/Portal.keychain"
    PORTALKCS="$XCS/SharedSecrets/PortalKeychainSharedSecret"
    sudo security -i <

    And do

    > importP12.sh your-P12-file.p12

    Password: your-administrator-password

    A dialog asking you for the P12 import password should appear and you are set.

提交回复
热议问题