準(zhǔn)備工作:
1, 獲取開發(fā)者的證書和秘鑰:

2, 配置gitlab的ssh
3, 配置jenkens
1, 下載安裝
GitLab Plugin
+ git plugin
+ credentials plugin
+ Keychains and Provisioning Profiles Management
+ Xcode integration+ssh plugin
4, 上傳keychain + Provisioning Profiles

5, 新建job
6, 配置job的gitlab地址和公鑰







xcodebuild -archivePath " 生成的文件.xcarchive" -project 項(xiàng)目名稱.xcodeproj -sdk iphoneos ?-scheme "項(xiàng)目名稱" -configuration "Release Adhoc" archive
xcodebuild -exportArchive -exportFormat IPA -exportProvisioningProfile "開發(fā)者證書名稱" -archivePath "生成的文件.xcarchive" -exportPath "生成ipa地址/名字.ipa"
注意:
在這里容易出現(xiàn)兩種錯(cuò)誤情況:
問題一, , ERROR: Cannot find schemes. Please consider creating shared schemes in Xcode.

這個(gè)問題的原因是我們沒有生成shared schemes 造成的, 知道問題的原因,解決起來就不太難了.

問題二, ?User interaction is not allowed.

這個(gè)問題的原因是jenkens沒有權(quán)限讀取開發(fā)者的賬戶信息, 要修改秘鑰訪問控制如下圖:

5, 上傳到fir
參考此地址:
http://blog.fir.im/jenkins/