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?
      1. Automate screenshots
      1. Automate beta distribution to TestFlight
      1. Automate App Store distribution
      1. 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
ActionDescriptionSupported Platforms
scanAlias for the run_tests actionios, mac
slatherUse slather to generate a code coverage reportios, mac
swiftlintRun swift code validation using SwiftLintios, mac
xcovNice code coverage reports without hassleios, mac
sonarInvokes sonar-scanner to programmatically run SonarQube analysisios, android, mac
oclintLints implementation files with OCLintios, android, mac
gcovrRuns test coverage reports for your Xcode projectios
lcovGenerates coverage data using lcovios, mac
appiumRun UI test by Appium with RSpecios, android
xctoolRun tests using xctoolios, mac
run_testsEasily run tests of your iOS app (via scan)ios, mac
xcode_server_get_assetsDownloads Xcode Bot assets like the .xcarchive and logsios, 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]

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值