I have a script that builds and archives an iOS App using xcodebuild. Running it manually on the CI server works perfectly, but it always fails if run as a task in Bamboo:
/Users/bamboo/Library/Developer/Xcode/DerivedData/MyApp-fznnexbqdbnwoebohwwvajvtmcdf/Build/Intermediates/ArchiveIntermediates/LIVE/InstallationBuildProductsLocation/Applications/MyApp.app: unknown error -1=ffffffffffffffff
Command /usr/bin/codesign failed with exit code 1
** ARCHIVE FAILED **
the archive command looks like this:
xcodebuild -workspace "${workspace}" -scheme "${scheme}" -archivePath "${archive_path}" clean archive
I did try:
- using
security unlock-keychainbefore thexcodebuildcommand - chaining
security unlock-keychainandxcodebuildcommands with&& - manually unlocking keychain
- moving the signing certificate and key to System keychain
- setting
Allow all applications to access this itemin keychain - searching SO and everything else (even asking the janitor :) )
If this is of any help, the project uses manual signing, the profile and certificate are specified in build settings because those change quite often, nevertheless the logs show that the right signing identity is picked up.
Any suggestions of what could be wrong are welcome.