1.xCode Plugin插件(必要)
2.Credentials设置Git的用户名密码
3.主界面->系统管理->Keychains and Provisioning Profiles Management配置Keychains
拷贝/Library/keychains/login.keychain到桌面,上传login.keychain
添加Identites :iPhone Distribution: TuoTianWeiYe(Beijing) Financial Information Service Co., Ltd.(MYKFH8D75G)
iPhone Developer: Kong LingShan (K3A344KMZ2)
添加Provisioning Profiles文件目录:/Users/alankong/Library/MobileDevice/Provisioning Profiles
4..建立自由风格的项目
设置Project url :https://github.com/tuotiansudai/tuotian_iOS/
设置代码仓库Repositories :https://github.com/tuotiansudai/tuotian_iOS.git和分支develop
Poll SCM H/10 * * * *(10分钟拉去一次代码,有改动则构建)
5.构建环境
选择Keychains and Code Signing Identities(子项目自动填写?)
6.构建
填写Target :tuotianClient,Configuration:Debug or Release
Execute shell 打包.ipa文件并上传到蒲公英(根目录为工程目录):
xcrun -sdk iphoneos PackageApplication ./build/Debug-iphoneos/tuotianClient.app -o ~/Documents/tuotianClient.ipa
uKey=fd0d765d2504cxxxx64332746f50fbbd
#蒲公英上的API Key
apiKey=d79ec7b013cxxxx28908f958f27cce53
#要上传的ipa文件路径
IPA_PATH=~/Documents/tuotianClient.ipa
#执行上传至蒲公英的命令
echo "++++++++++++++upload+++++++++++++"
curl -F "file=@${IPA_PATH}" -F "uKey=${uKey}" -F "_api_key=${apiKey}" http://www.pgyer.com/apiv1/app/upload
7.E-mail Notification
构建失败发送邮件 空格隔开
必须先设置smtp发件服务器
主目录->系统设置->邮件通知(SMTP服务器smtp.gmail.com,使用SMTP认证用户名:kongglin@gmail.com,密码:Rainxxxx,SMTP端口465)
8.远程slave构建注意事项
1)勾选 Restrict where this project can be run并填写slave标签
2)解锁keychain,Code signing & OS X keychain options->勾选Unlock Keychain,填写路径/Users/ttsd/Library/Keychains/login.keychain-db和机器登录密码