Fastlane基础介绍
程序员文章站
2023-01-01 11:43:20
Fastlane是什么 "Fastlane" "Fastlane Document" Fastlane是一整套的客户端CICD工具集合。Fastlane可以非常快速简单的搭建一个自动化发布服务,并且支持Android,iOS,MacOS。 Fastlane命令执行的底层并不是自己实现的,而是调用其他 ......
fastlane是什么
-
git地址:
fastlane -
文档地址:
fastlane document- fastlane是一整套的客户端cicd工具集合。fastlane可以非常快速简单的搭建一个自动化发布服务,并且支持android,ios,macos。
- fastlane命令执行的底层并不是自己实现的,而是调用其他的插件或者工具执行的。比如说打包,fastlane中的gym工具只是xcodebuild工具的一个封装,调用的其实还是xcodebuild中的打包命令。
- fastlane本身没有一套特殊语法,使用的ruby语言。
- fastlane的插件工具叫做action,每一个action都对应一个具体的功能
fastlane安装
1、安装xcode命令行工具,在终端输入:
xcode-select --install
2、安装fastlane,在终端输入:
//方式一:using rubygems sudo gem install fastlane -nv //方式二:using homebrew brew cask install fastlane
fastlane初始化工程
1、进入工程的根目录,在终端输入fastlane初始化命令:
sudo fastlane init
2、初始化完成后会要求选择创建目的:
- what would you like to use fastlane for?
- automate screenshots
- automate beta distribution to testflight
- automate app store distribution
- manual setup - manually setup your project to automate your tasks
如果是要上传applestore选3,如果是企业版选4
3、安装验证
- 在fastlane文件中写入:
default_platform(:ios) platform :ios do desc "生成本地版本" lane :testabc do build_app(scheme: "zeus") end end
- 进入工程的根目录,在终端输入:
fastlane testabc desc:测试打包
fastlane常用工具(action)
查询action:
在命令行输入:
//查询所有action fastlane actions //查询制定action fastlane action [action_name]
action分类:
- testing
action | description | supported platforms |
---|---|---|
scan | alias for the run_tests action | ios, mac |
slather | use slather to generate a code coverage report | ios, mac |
swiftlint | run swift code validation using swiftlint | ios, mac |
xcov | nice code coverage reports without hassle | ios, mac |
sonar | invokes sonar-scanner to programmatically run sonarqube analysis | ios, android, mac |
oclint | lints implementation files with oclint | ios, android, mac |
gcovr | runs test coverage reports for your xcode project | ios |
lcov | generates coverage data using lcov | ios, mac |
appium | run ui test by appium with rspec | ios, android |
xctool | run tests using xctool | ios, mac |
run_tests | easily run tests of your ios app (via scan) | ios, mac |
xcode_server_get_assets | downloads xcode bot assets like the .xcarchive and logs | ios, mac |
- building
- screenshots
- project
- code signing
- documentation
- beta
- push
- releasing your app
- source control
- notifications
- app store connect
- misc
- deprecated
踩坑笔记
1.报missing private key:
需要从有证书的mac中导入证书的p12私钥安装到新的打包机2.在compiling swift source files这一步再也不动了:
project --> build settings --> swift compiler-code generation 找到optimization level 将其设置为no optimization[-onone]