I'm setting up a CICD server with Azure DevOps Pipelines for my iOS application and am having trouble with code signing. I think the issue is Xcode being unable to access the keychain, so it displays a prompt for me to enter a password and provide access - I'm unable to enter this because it's running headless in the CI server.
I'm getting the same problem using xcodebuild and Fastlane gym.
Xcode build
xcodebuild build -workspace './ios/myApp.xcworkspace' -scheme 'myApp' -verbose
Output line it prompts for a keychain password:
GenerateDSYMFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app.dSYM /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/myApp (in target: myApp)
cd /Users/vsts/agent/2.150.3/work/1/s/ios
/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/myApp -o /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app.dSYM
PBXCp /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/Lottie.framework /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks/Lottie.framework (in target: myApp)
cd /Users/vsts/agent/2.150.3/work/1/s/ios
builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude \*.tbd -strip-debug-symbols -bitcode-strip replace-with-marker -bitcode-strip-tool /Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -strip-tool /Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/Lottie.framework /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks
/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -S /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/Lottie.framework/Lottie -o /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks/Lottie.framework/Lottie
/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks/Lottie.framework/Lottie -m -o /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks/Lottie.framework/Lottie
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests.hmap
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/all-product-headers.yaml (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/all-product-headers.yaml
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-project-headers.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-project-headers.hmap
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-own-target-headers.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-own-target-headers.hmap
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-generated-files.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-generated-files.hmap
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-target-headers.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-target-headers.hmap
WriteAuxiliaryFile /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-non-framework-target-headers.hmap (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
write-file /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-non-framework-target-headers.hmap
CompileC /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/armv7/Pods-myAppTests-dummy.o /Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Target\ Support\ Files/Pods-myAppTests/Pods-myAppTests-dummy.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
export LANG=en_US.US-ASCII
/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fobjc-weak -fmodules -fmodules-cache-path=/Users/vsts/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/vsts/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DPOD_CONFIGURATION_RELEASE=1 -DCOCOAPODS=1 -DPOD_CONFIGURATION_RELEASE=1 -DGPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 -DPOD_CONFIGURATION_RELEASE=1 -DPB_FIELD_32BIT=1 -DPB_NO_PACKED_STRUCTS=1 -DPB_ENABLE_MALLOC=1 -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode_10.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode-marker -iquote /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-generated-files.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-own-target-headers.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-non-framework-target-headers.hmap -ivfsoverlay /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/all-product-headers.yaml -iquote /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-project-headers.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/include -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/Firebase -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseAnalyticsInterop -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseCore -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseInstanceID -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseMessaging -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/GoogleUtilities -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/Protobuf -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/nanopb -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Firebase/CoreOnly/Sources -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources-normal/armv7 -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources/armv7 -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources -F/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos -F/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/GoogleAppMeasurement/Frameworks -MMD -MT dependencies -MF /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/armv7/Pods-myAppTests-dummy.d --serialize-diagnostics /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/armv7/Pods-myAppTests-dummy.dia -c /Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Target\ Support\ Files/Pods-myAppTests/Pods-myAppTests-dummy.m -o /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/armv7/Pods-myAppTests-dummy.o
CompileC /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/arm64/Pods-myAppTests-dummy.o /Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Target\ Support\ Files/Pods-myAppTests/Pods-myAppTests-dummy.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: Pods-myAppTests)
cd /Users/vsts/agent/2.150.3/work/1/s/ios/Pods
export LANG=en_US.US-ASCII
/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch arm64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu11 -fobjc-arc -fobjc-weak -fmodules -fmodules-cache-path=/Users/vsts/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/vsts/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DPOD_CONFIGURATION_RELEASE=1 -DCOCOAPODS=1 -DPOD_CONFIGURATION_RELEASE=1 -DGPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1 -DPOD_CONFIGURATION_RELEASE=1 -DPB_FIELD_32BIT=1 -DPB_NO_PACKED_STRUCTS=1 -DPB_ENABLE_MALLOC=1 -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode_10.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -miphoneos-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -fembed-bitcode-marker -iquote /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-generated-files.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-own-target-headers.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-all-non-framework-target-headers.hmap -ivfsoverlay /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/all-product-headers.yaml -iquote /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Pods-myAppTests-project-headers.hmap -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/include -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/Firebase -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseAnalyticsInterop -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseCore -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseInstanceID -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/FirebaseMessaging -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/GoogleUtilities -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/Protobuf -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Headers/Public/nanopb -I/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Firebase/CoreOnly/Sources -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources-normal/arm64 -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources/arm64 -I/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/DerivedSources -F/Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos -F/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/vsts/agent/2.150.3/work/1/s/ios/Pods/GoogleAppMeasurement/Frameworks -MMD -MT dependencies -MF /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/arm64/Pods-myAppTests-dummy.d --serialize-diagnostics /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/arm64/Pods-myAppTests-dummy.dia -c /Users/vsts/agent/2.150.3/work/1/s/ios/Pods/Target\ Support\ Files/Pods-myAppTests/Pods-myAppTests-dummy.m -o /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/Pods.build/Release-iphoneos/Pods-myAppTests.build/Objects-normal/arm64/Pods-myAppTests-dummy.o
CodeSign /Users/vsts/Library/Developer/Xcode/DerivedData/safepoint-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/safepoint.app/Frameworks/Lottie.framework (in target: safepoint)
cd /Users/vsts/agent/2.150.3/work/1/s/ios
export CODESIGN_ALLOCATE=/Applications/Xcode_10.2.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "iPhone Developer: XXXX XXXXX (XXXXXX)"
Provisioning Profile: "match Development com.jamesrogers.myApp"
(XXXXXXXXXXXXXXXXXXXXXXXXXx)
/usr/bin/codesign --force --sign 91BB2EBDF2635F1D8B951B60FDA0CB8406EA5B85 --timestamp=none --preserve-metadata=identifier,entitlements,flags /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Products/Release-iphoneos/myApp.app/Frameworks/Lottie.framework
Fastlane gym
gym(scheme: 'myApp', workspace: './ios/myApp', verbose: true)
Output line it prompts for a keychain password:
Generating 'myApp.app.dSYM'
Copying /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/Lottie.framework
Attempted solutions
I have tried two things to get around this, but they both result in Xcode prompting me for keychain access.
- I tried unlocking the keychain but failed to find any concrete information online on how to do so. Firstly, I don't know what keychain to use or what password to use. From some information I found here, it appears the password for the default keychain "is normally the password for the user that is starting the agent". Does this mean it's the password for my azure devops account? I then run the following to see all my available keychains:
security list-keychains
// output
"/Users/vsts/Library/Keychains/login.keychain-db"
"/Library/Keychains/System.keychain"
I'm assuming the default keychain is login.keychain-db, since I don't have permission to access System.keychain.
Running the following using my azure devops account password with fastlane (right before match and gym):
unlock_keychain(
path: "/Users/vsts/Library/Keychains/login.keychain-db",
password: "myPassword")
)
or using security util (before fastlane match and gym):
security unlock-keychain -p myPassword /Users/vsts/Library/Keychains/login.keychain-db
This still results in the same problem. I also get some warnings from fastlane match:
[12:06:53]: Could not configure imported keychain item (certificate) to prevent UI permission popup when code signingCheck if you supplied the correct `keychain_password` for keychain: `/Users/vsts/Library/Keychains/login.keychain-db`security: SecKeychainItemSetAccessWithPassword: The user name or passphrase you entered is not correct.
[12:06:53]:
[12:06:53]: Please look at the following docs to see how to set a keychain password:
[12:06:53]: - https://docs.fastlane.tools/actions/sync_code_signing
[12:06:53]: - https://docs.fastlane.tools/actions/get_certificates
This indicates the keychain name or password is incorrect, and tells me that I xcode will prompt me for the keychain password. Does anybody know what the password should be?
- My other attempt was to create a new keychain to install and read the certificates. I've tried this using built-in fastlane actions and the security command utility. I also set the newly created keychain to default, added it to the search list and unlocked it.
In Fastfile before match and gym:
create_keychain(
name: 'ios-build',
password: 'password123',
default_keychain: true,
unlock: true,
add_to_search_list: true
)
or using security util (before fastlane match and gym):
security create-keychain -p password123 ios-build.keychain // create keychain
security list-keychains -d user -s login.keychain ios-build.keychain // add to search path
security unlock-keychain -p password123 /Users/vsts/Library/Keychains/ios-build.keychain-db // unlock
I also set the MATCH_KEYCHAIN_NAME and MATCH_KEYCHAIN_PASSWORD environment variables to reference this new keychain.
This time, the warnings from match are gone (suggesting it has correctly installed the certs and profiles to the new keychain), but it still hangs on the keychain password prompt when building. I also tried this with an empty password for the keychain - exact same problem. I am wondering if Xcode is still trying to access the original default keychain, and not the newly created one? If so, do I need to configure xcode/gym to look for the newly created keychain?
The tools I'm using:
- Microsoft Hosted Agent: macOS-10.14
- Xcode: 10.2.1
- Fastlane: 2.123.0