持续集成

使用fastlane创建profile、添加设备、创建推送证书

2017-05-17  本文已影响490人  冰琳92
  1. 安装
sudo gem install fastlane --verbose

Seems like launching fastlane takes a while - please run

$ [sudo] gem cleanup //卸载过期的gem 可以让fastlane运行更快

推荐使用Gemfile来管理依赖

 $ bundle init
 $ echo 'gem "fastlane"' >> Gemfile
 $ bundle install
  1. 初始化
fastlane init
lane :beta do
    gym(scheme: "name",
    configuration: "Debug",//默认为Release
    workspace: "name.xcworkspace")
end
  1. 创建app profile
fastlane sigh
fastlane sigh --adhoc
fastlane sigh --development
fastlane sigh -a com.krausefx.app -u username
  1. 添加设备
fastlane run register_device 
// input name
// input device uiid
  1. 添加设备后更新profile
fastlane sigh --development --force
  1. 创建推送证书
fastlane pem --development
  1. 打包ipa
a
  1. 添加上传至蒲公英
    sh "curl -F 'file=@pathto/app.ipa' -F 'uKey=userkey in pgyer ' -F '_api_key=apikey in pgyer' http://www.pgyer.com/apiv1/app/upload -F 'updateDescription=test update'"

lane :beta do
   increment_build_number #让project的build版本自增
`//需要设置CURRENT_PROJECT_VERSION为info.plist里的build号`
    gym(scheme: "yours scheme",
    configuration: "Debug",//默认为Release
    workspace: "yours.xcworkspace")
end

increment_build_number实际上是调用的apple的agvtool next-version -all
可以参考文档p.p1 https://developer.apple.com/library/ios/qa/qa1827/_index.html

上一篇下一篇

猜你喜欢

热点阅读