- 安装
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
- 初始化
fastlane init
lane :beta do
gym(scheme: "name",
configuration: "Debug",//默认为Release
workspace: "name.xcworkspace")
end
- 创建app profile
- release
fastlane sigh
- adhoc
fastlane sigh --adhoc
- development
fastlane sigh --development
- 对某个app操作
fastlane sigh -a com.krausefx.app -u username
- 添加设备
fastlane run register_device
// input name
// input device uiid
- 添加设备后更新profile
fastlane sigh --development --force
- 创建推送证书
fastlane pem --development
- 打包ipa
a
- 添加上传至蒲公英
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