0

i'm try to set up in jenkins for build IOS but i have this problem ↓

Command PhaseScriptExecution failed with a nonzero exit code

** ARCHIVE FAILED **


The following build commands failed:
    PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/imac/Library/Developer/Xcode/DerivedData/thaiinfo-fejujxllcuzoxdgfelazriqdkpxt/Build/Intermediates.noindex/ArchiveIntermediates/thaiinfo/IntermediateBuildFilesPath/thaiinfo.build/Release-iphoneos/thaiinfo.build/Script-7145B11BB11164E5D77D6B12.sh
(1 failure)
Build step ‘Xcode’ marked build as failure
[OS X] restore keychains as defined in global configuration
[Sample_ios_swift] $ /usr/bin/security list-keychains -s /Users/imac/Library/Keychains/login.keychain
[Sample_ios_swift] $ /usr/bin/security default-keychain -d user -s /Users/imac/Library/Keychains/login.keychain
Finished: FAILURE

how can i do solve this? I'm using Xcode 10.1 , Jenkins 2.159 I've already searched it but i can't solve this.

Hyungjoon Cho
  • 47
  • 1
  • 8
  • Could you please post more error logs here? If it is a codesign / keychain issue, please refer this answer: https://stackoverflow.com/questions/51649727/codesign-returned-errsecinternalcomponent-in-high-sierra/53552270#53552270 – Anand Feb 21 '19 at 16:29

2 Answers2

3

I had the same problem so I will explain how I could make it work :

  • Open a terminal
  • Go on your project root, the one created by Jenkins
  • You have to be jenkins user: sudo su jenkins
  • Launch xcodebuild command (you can get it from your console output in jenkins)
  • You should have at a moment a pop up about xcode signing, choose to always allow.
  • Now you should be able to compile your iOS app on Jenkins.
CoyBit
  • 1,592
  • 1
  • 17
  • 19
ffrik
  • 46
  • 1
0

In my case, It's not like this. You have to access the keychain from CI shell (Jenkins) with the following command:

security set-key-partition-list -S apple-tool:,apple: -s -k $PASSWORD -t private /Users/******/Library/Keychains/login.keychain-db

This took me about 1.5 days to figure this out. I hope my answer can help someone else too. Actually the issue has been discussed here: security / codesign in Sierra: Keychain ignores access control settings and UI-prompts for permission

Scriptable
  • 19,402
  • 5
  • 56
  • 72
Michael
  • 1
  • 6