Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-14016

Xcode codesign fails in Jenkins but works as user running Jenkins

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • xcode-plugin
    • Mac OS X (10.7.4, 10.7.3), Jenkins 1.466, XCode integration 1.3.1

      I've read the Xcode plugin FAQ, but I'm still getting this errorBuilding my app in Jenkins, I get:

      CodeSign build/Release-iphoneos/myApp.app
      cd /Users/Shared/Jenkins/Home/workspace/myApp/myApp
      setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
      setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
      /usr/bin/codesign --force --sign 8d5f448fb2390ad8bc4604f1e1a1a74ef022aff7 --resource-rules=/Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/Release-iphoneos/myApp.app/ResourceRules.plist --entitlements /Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/myApp.build/Release-iphoneos/myApp.build/myApp.xcent /Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/Release-iphoneos/myApp.app
      /Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/Release-iphoneos/myApp.app: User interaction is not allowed.
      Command /usr/bin/codesign failed with exit code 1

        • BUILD FAILED **

      When I try the same commands from Terminal, I get:

      [myComputer:~] jenkins%
      cd /Users/Shared/Jenkins/Home/workspace/myApp/myApp

      [myComputer:workspace/myApp/myApp] jenkins%
      setenv CODESIGN_ALLOCATE /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate

      [myComputer:workspace/myApp/myApp] jenkins%
      setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

      [myComputer:workspace/myApp/myApp] jenkins%
      /usr/bin/codesign --force --sign 8d5f448fb2390ad8bc4604f1e1a1a74ef022aff7 --resource-rules=/Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/Release-iphoneos/myApp.app/ResourceRules.plist --entitlements /Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/myApp.build/Release-iphoneos/myApp.build/myApp.xcent /Users/Shared/Jenkins/Home/workspace/myApp/myApp/build/Release-iphoneos/myApp.app

      If I've cleared keychain access to the dev cert, I will get a dialog asking me to allow access when I run the command from the Terminal.

      When I run it from Jenkins, I do not see a dialog. If access is always allowed and I don't get a dialog when I run from the Terminal, I still can't get a successful build from Jenkins.

      I'm reporting this as a defect because it works from the command line, but I know it might be my fault.

      Thanks,
      Ben

            sti Sami Tikka
            benatondeqdotcom Ben Place
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: