经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 移动开发 » iOS » 查看文章
Fastlane基础介绍
来源:cnblogs  作者:柳云居士  时间:2019/6/21 11:32:22  对本文有异议

Fastlane是什么

  • Git地址: Fastlane
  • 文档地址:Fastlane Document

    • Fastlane是一整套的客户端CICD工具集合。Fastlane可以非常快速简单的搭建一个自动化发布服务,并且支持Android,iOS,MacOS。
    • Fastlane命令执行的底层并不是自己实现的,而是调用其他的插件或者工具执行的。比如说打包,Fastlane中的gym工具只是xcodebuild工具的一个封装,调用的其实还是xcodebuild中的打包命令。
    • Fastlane本身没有一套特殊语法,使用的Ruby语言。
    • Fastlane的插件工具叫做action,每一个action都对应一个具体的功能

Fastlane安装

1、安装xcode命令行工具,在终端输入:

  1. xcode-select --install

2、安装Fastlane,在终端输入:

  1. //方式一:Using RubyGems
  2. sudo gem install fastlane -NV
  3. //方式二:Using Homebrew
  4. brew cask install fastlane

Fastlane初始化工程

1、进入工程的根目录,在终端输入Fastlane初始化命令:

  1. 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文件中写入:
  1. default_platform(:ios)
  2. platform :ios do
  3. desc "生成本地版本"
  4. lane :testabc do
  5. build_app(scheme: "ZEUS")
  6. end
  7. end
  • 进入工程的根目录,在终端输入:
  1. fastlane testabc desc:测试打包

Fastlane常用工具(action)

查询action:

在命令行输入:

  1. //查询所有action
  2. fastlane actions
  3. //查询制定action
  4. 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]

原文链接:http://www.cnblogs.com/anywherego/p/11062826.html

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号