Jenkins + SVN + Cocoapods 實現iOS自動化打包

安裝Jenkins

推薦使用命令行安裝

1.安裝jenkins

brew install jenkins

Paste_Image.png

2.啟動jenkins

jenkins

Paste_Image.png

如果沒安裝homebrew,先安裝homebrew
3.啟動完成,地址為:http://localhost:8080/

配置Jenkins

admin 密碼(個人感覺還是記一下比較好,在jenkins啟動時候可以看到)

Paste_Image.png

然后接下來就是安裝需要的插件了,直接選擇默認的就好了
進入jenkins之后還可以安裝襲擊需要的插件,推薦

Paste_Image.png

Xcode integration :用于讀取Xcode中項目配置
Post-Build Script Plug-in:這個插件的功能主要是用于在build后執行相關腳本
Keychains and Provisioning Profiles Management:用于鑰匙串

證書配置

1.點擊 Manage Jenkins-> [Keychains and Provisioning Profiles Management] 進入如下頁面

Paste_Image.png
Paste_Image.png

2.點擊choose File 并上傳 當前登錄用戶的~/Library/Keychain/login.keychain文件.上傳成功后會出現:

Paste_Image.png

3.上傳Provisioning Profiles文件,xcode的profile存放在~/Library/MobileDevice/Provisioning Profiles/中,找到你要的profile,上傳

Paste_Image.png

新建一個項目

1.點擊左側工具欄"新建",選擇第一項"構建一個自由風格的軟件項目"

Paste_Image.png

2.基本配置

Paste_Image.png

3.源碼管理(這里使用SVN)

Paste_Image.png

4.定時打包


Paste_Image.png

5.執行Cocoapods 更新腳本

Paste_Image.png

6.讀取Xcode 設置

Paste_Image.png
Paste_Image.png
Paste_Image.png

7.保存配置之后,去構建自己的項目

Paste_Image.png

8.通過Console output查看日志,也可以從中查找錯誤

Paste_Image.png

9.出現success的標志就意味著打包成功了,可以根據顯示的路徑4查看打出的ipa文件

Paste_Image.png

10.構建過程中如果提示ResourceRules.plist的錯誤需要在xcode工程里添加$(SDKROOT)/ResourceRules.plist

Paste_Image.png
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容