fastlane -- 自动化构建

56 阅读1分钟

Fastfile 复用

import local Fastfile

import '/Users/tangge/Desktop/fastlane_ app/fastlane/Fastfile

import remote Fastfile

import_ from git(
url: ' git@github . com: MyAwesomeRepo/ MyAwesomeFastlaneStandardSetup.git',
branch: 'master'
# path:'fastlane/Fastfile'
)

App自动化构建

配置APP目录下的ruby环境

  1. rvm配置
cd /Users/tanggee/Downloads/ios-app
echo 2.7.2 > .ruby-version
echo ios_app > .ruby-gemset
cd ..
cd ios-app
  1. empty gemset
rvm gemset list
rvm gemset empty ios_app
  1. 安装bundler
gem install bundler -v 2.1.4
  1. 初始化bundler环境
bundle init
  1. 添加 ruby gem 依赖
gem 'cocoapods' , '1.10.1'
gem 'fastlane' , '>= 2.209.0', '< 3.0'
  1. bundle install
bundle _2.1.4_ install
  1. 初始化 CocoaPods
bundle exec pod init
  1. 初始化 fastlane
bundle exec fastlane init
  1. 配置构建参数
===========.build.yaml===============
---
scheme: MyApp
target: MyApp
app_ identifier: com.tangge.car
bundle version: 3.5.0
xcworkspace: MyApp.xcworkspace
configuration: Release
export_ method: adHoc #enterprise 、TestFlight、AppStore
access_ token url:
secret :
agentid:
send message_ url:
  1. 安装rake库

bundle exec rake
  1. 简化调用入口,Makefile
===========Makefile===============
all:
	bundle install
	bundle exec rake