~/.fastlane/bin 自动版本递增配置 https://developer.apple.com/library/archive/qa/qa1827/_index.html
蒲公英自动打包
- 先安装fastlane,Using RubyGems
sudo gem install fastlane -NV
Alternatively using Homebrew
brew cask install fastlane
如果镜像有问题 https://note.youdao.com/share/?id=a053a7ca4a92ca4ff91e34a1a7d737c7&type=note#/
- 安装 Xcode command line tools:
xcode-select --install
- 安装蒲公英fastlane插件
fastlane add_plugin pgyer
- 初始化
fastlane init
- 修改配置文件 /fastlane/Fastfile 如下:
lane :beta do
gym(export_method: "ad-hoc")
pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", user_key: "4a5bcxxxxxxxxxxxxxxx3a9e")
end
api_key user_key 去蒲公英对应应用的api选项中查看。 一个lane就是一个任务,beta名字可以自己改,gym是fastlane提供的打包工具,括号里面就是你自己配置的一些东西。(https://docs.fastlane.tools/actions/gym/)或者或者终端命令(fastlane action gym)
- 打包 Appfile:主要是app_identifier(bundle id)和apple_id(开发者账号)
Fastlane文件中有:fastlane beta (beta指的是对应lane的名字 lane :beta do) ,如果前面有 platform :ios do 可以 fastlane ios beta
如果运行有这个问题
[!] Unable to locate Xcode. Please make sure to have Xcode installed on your machine
去xcode 打开偏好设置 选择locations,将command line tools勾选一下