fastlane安裝使用使用的教程很多舰绘,套路基本固定墅垮。此處僅記錄耗費了自己幾天時間的坑民假,以便后續(xù)方便查閱。有個感悟:有問題一定要看官方文檔以及issues抓于,相信自己不是第一個遇到……
一:security: SecKeychainItemImport: The specified keychain could not be found. Could not install WWDR certificate
1做粤、security list-keychains 可以查看所有keychain
使用該命令之后,我這邊的輸入是:
"/Library/Developer/XcodeServer/Keychains/Portal.keychain"
"/Users/XXX/Library/Keychains/login.keychain-db"
"/Library/Keychains/System.keychain"
你會發(fā)現(xiàn)第一個Portal,keychain中沒有WWDR證書
所以根據(jù)fastlane issue中的方法將login-keychain-db(包含WWDR) 放在第一位毡咏,具體方法十分簡單
再使用 security list-keychains,login.keychain-db即在第一位了驮宴,感覺是fastlane代碼沒有寫的嚴謹
"/Users/XXX/Library/Keychains/login.keychain-db"
"/Library/Developer/XcodeServer/Keychains/Portal.keychain"
"/Library/Keychains/System.keychain"
參考: https://github.com/fastlane/fastlane/issues/6993
記錄個命令:
security find-certificate -c 'Apple Worldwide Developer Relations Certification Authority'
可以查找某個證書的詳情
二:復用現(xiàn)有的證書
參考這邊文章即可: http://macoscope.com/blog/simplify-your-life-with-fastlane-match/#migration
上邊有詳細步驟
有個注意點,提交之前刪除其余p12呕缭、cer等文件堵泽,只留下 cert_id.cer和cert_.p12,否則 Passphrase for Git Repo 這一步過不去
還有openssl 的密碼要記住
三:Could not decrypt the repo, please make sure you enter the right password!
解決方法: 在Fastfile的 before_all方法中恢总,添加 ENV["MATCH_PASSWORD"] = 密碼,示例: ENV["MATCH_PASSWORD"] = "123456"
四: ommand timed out after 10 seconds on try 1 of 4
原因: 很大可能是機器不給力了迎罗,使xcodebuild -showBuildSettings -workspace ./XX.xcworkspace -scheme XX -configuration Release 命令執(zhí)行超時
解決方法: 在Fastfile的 before_all方法中,添加 :
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "4"
也就是重置超時時間和重試次數(shù)片仿,可根據(jù)自己需要修改