Jenkins+ Xcode+ 蒲公英 实现IOS自动化打包和分发
Posted lance.xiang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jenkins+ Xcode+ 蒲公英 实现IOS自动化打包和分发相关的知识,希望对你有一定的参考价值。
Jenkins+ Xcode+ 蒲公英 实现ios自动化打包和分发
直接入正题:
![](http://upload-images.jianshu.io/upload_images/656181-b1390fddc8709851.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
Mac上安装Jekins
jekins下载地址:http://jenkins-ci.org/ ,选择Mac 直接安装。安装成功后。访问http://localhost 是否可正常访问.
安装Jekins相关插件
xcode插件
2.https://wiki.jenkins-ci.org/display/JENKINS/XCode+Plugin#XcodePlugin-Installationguide
脚本执行插件
3.https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin
git插件
4.https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin
IOS证书管理和修正
1.点击 Manage Jenkins-> [Keychains and Provisioning Profiles Management] 进入如下页面
![](http://upload-images.jianshu.io/upload_images/656181-abbc633a0db4a52e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2.点击choose File 并上传 当前登录用户的~/Library/Keychain/login.keychain文件.
上传成功后会出现:
![](http://upload-images.jianshu.io/upload_images/656181-43a109ece0c67cc5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
点击Add Code Signing Identity添加对应的签名
3.上传Provisioning Profiles文件,xcode的profile存放在~/Library/MobileDevice/Provisioning Profiles/中,找到你要的profile,上传
![](http://upload-images.jianshu.io/upload_images/656181-8ab39726714398d4.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
这步很重要,如果证书出错请查看:http://www.cnblogs.com/qingjoin/p/3929493.html
新建项目
1.New Item -> 选择FreeStyle project
2.关联GIt
![](http://upload-images.jianshu.io/upload_images/656181-9bea38ef9379c412.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
3.Xcode的相关配置
![](http://upload-images.jianshu.io/upload_images/656181-b8905a9740b34cee.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/656181-9264aae401a6520b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/656181-d93621a10c63f162.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4.ipa上传到蒲公英和发送邮件
![](http://upload-images.jianshu.io/upload_images/656181-9a576f3f48dec9f9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
5.相关的python文件的地址为:
https://github.com/caiwenshu/CI_pgy/blob/master/pgy_upload_temp.py
该代码引用来自:http://www.cocoachina.com/ios/20150428/11698.html
原文 http://www.jianshu.com/p/371595ef08fe
以上是关于Jenkins+ Xcode+ 蒲公英 实现IOS自动化打包和分发的主要内容,如果未能解决你的问题,请参考以下文章
Mac Jenkins+fastlane 简单几步实现iOS自动化打包发布