使用 Xcode 和 Fastlane 在 Azure DevOps Pipelines 中对 iOS 应用程序进行代码签名时遇到问题

Trouble code signing iOS application in Azure DevOps Pipelines with Xcode and Fastlane

我正在为我的 iOS 应用程序设置带有 Azure DevOps Pipelines 的 CICD 服务器,但在代码签名方面遇到了问题。我认为问题是 Xcode 无法访问钥匙串,因此它会提示我输入密码并提供访问权限 - 我无法输入它,因为它 运行ning 无头CI 服务器。

我在使用 xcodebuild 和 Fastlane gym 时遇到了同样的问题。

Xcode 建造

xcodebuild build -workspace './ios/myApp.xcworkspace' -scheme 'myApp' -verbose

提示输入钥匙串密码的输出行:

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

快车道健身房

gym(scheme: 'myApp', workspace: './ios/myApp', verbose: true)

提示输入钥匙串密码的输出行:

Generating 'myApp.app.dSYM'
‌Copying‌ /Users/vsts/Library/Developer/Xcode/DerivedData/myApp-baobuhuxmmxrfqdivdrvlrzqvfby/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/Lottie.framework‌

尝试过的解决方案

我尝试了两种方法来解决这个问题,但它们都会导致 Xcode 提示我进行钥匙串访问。

  1. 我尝试解锁钥匙串,但未能在网上找到有关如何解锁的任何具体信息。首先,我不知道要使用什么钥匙串或使用什么密码。根据我发现的一些信息 here,它显示默认钥匙串的密码 "is normally the password for the user that is starting the agent"。这是否意味着它是我的 azure devops 帐户的密码?然后我 运行 以下内容以查看我所有可用的钥匙串:
security list-keychains

// output
"/Users/vsts/Library/Keychains/login.keychain-db"
"/Library/Keychains/System.keychain"

我假设默认钥匙串是 login.keychain-db,因为我没有访问 System.keychain.

的权限

运行 以下使用我的 azure devops 帐户密码和 fastlane(就在比赛和健身房之前):

unlock_keychain(
  path: "/Users/vsts/Library/Keychains/login.keychain-db",
  password: "myPassword")
)

或使用安全工具(在快车道比赛和健身房之前):

security unlock-keychain -p myPassword /Users/vsts/Library/Keychains/login.keychain-db

这仍然会导致同样的问题。我还从 fastlane 匹配中收到一些警告:

[12:06:53]: ‌Could not configure imported keychain item (certificate) to prevent UI permission popup when code signing‌Check 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‌

这表示钥匙串名称或密码不正确,并告诉我 xcode 会提示我输入钥匙串密码。有人知道密码应该是什么吗?

  1. 我的另一个尝试是创建一个新的钥匙串来安装和读取证书。我已经使用内置的快速通道操作和安全命令实用程序进行了尝试。我还将新建的钥匙串设置为默认,将其添加到搜索列表并解锁。

在比赛和健身房之前的 Fastfile 中:

create_keychain(
  name: 'ios-build',
  password: 'password123',
  default_keychain: true,
  unlock: true,
  add_to_search_list: true
)

或使用安全工具(在快车道比赛和健身房之前):

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

我还设置了 MATCH_KEYCHAIN_NAMEMATCH_KEYCHAIN_PASSWORD 环境变量来引用这个新的钥匙串。

这一次,来自 match 的警告消失了(表明它已将证书和配置文件正确安装到新的钥匙串),但在构建时它仍然挂在钥匙串密码提示上。我也尝试过使用钥匙串的空密码 - 完全相同的问题。我想知道 Xcode 是否仍在尝试访问原始默认钥匙串,而不是新创建的钥匙串?如果是这样,我是否需要配置 xcode/gym 来查找新创建的钥匙串?

我使用的工具:

Fastlane 有一个操作 setup_ci,可用于准备钥匙串并匹配在 CI 环境中使用。

provider 参数是可选的,但如果您的 CI 提供商未被自动正确识别,您可能必须设置 force:true。 (如果是这种情况,请在 fastlane 上打开一个问题。谢谢。)