由于在Xcode 9 之后禁止其直接訪問鑰匙串, 導(dǎo)致持續(xù)集成時(shí)執(zhí)行 xcode build 會(huì)出現(xiàn)找不到證書或證書配置文件的問題:
Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
這個(gè)可以修改 fastlane 配置文件來解決:
具體就是在調(diào)用和構(gòu)建相關(guān)的 action 的時(shí)候, 加入一個(gè): export_xcargs: "-allowProvisioningUpdates" 即可.
附上一個(gè)示例 FastFile:
fastlane_version "2.61.0"
default_platform :ios
platform :ios do
before_all do
cocoapods
carthage
end
desc "Runs all the tests"
lane :test do
scan(
device: "iPhone 6s"
)
end
desc "Submit a new Beta Build to Apple TestFlight"
desc "This will also make sure the profile is up to date"
lane :beta do
gym(scheme: "xxxxx", configuration: "Debug", export_method: "ad-hoc", export_xcargs: "-allowProvisioningUpdates")
end
desc "Deploy a new version to the App Store"
lane :release do
gym(scheme: "xxxxx", export_method: "app-store", export_xcargs: "-allowProvisioningUpdates")
end
after_all do |lane|
end
error do |lane, exception|
end
end
使用該參數(shù)的情況下, 可能會(huì)在執(zhí)行持續(xù)集成構(gòu)建的機(jī)器上彈窗請(qǐng)求訪問鑰匙串的權(quán)限, 只要允許了即可.