最牛X的iOS、安卓自动打包管理工具,没有之一,The easiest way to build and release mobile apps.ios
1.Ruby环境api
2.Xcoderuby
安装fastlanebash
# Using RubyGemssudo gem install fastlane -NV
//或者
# Alternatively using Homebrewbrew cask install fastlane
复制代码
使用fastlaneapp
1. cd + 项目目录 ide
四个选项: 1.自动截屏 2.自动发布TestFlight 3.自动发布AppStore 4.手动设置 咱们测试 选择4,此时项目中会出现一个fastlane文件夹和两个文件如图: 函数
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
# apple_id("[[APPLE_ID]]") # Your Apple email address
# For more information about the Appfile, see:
# https://docs.fastlane.tools/advanced/#appfile
复制代码
Fastfile工具
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :custom_lane do
# add actions here: https://docs.fastlane.tools/actions
end
end
复制代码
这些是Ruby代码,和CocoaPods内代码相似:测试
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :veronica do
version = get_version_number
ipaName = "veronica_#{version}.ipa"
gym(
scheme:"veronica",
export_method:"development",
configuration:"Release",
output_name:"#{ipaName}",
output_directory:"./build"
)
end
end
复制代码
开始打包 ui
cd到项目目录下,安装fir的插件,执行命令
fastlane add_plugin firim
复制代码
编写Fastfile文件,添加firim相关代码
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :veronica do
version = get_version_number
ipaName = "veronica_#{version}.ipa"
firim_api_token="*********************"
gym(
scheme:"veronica",
export_method:"development",
configuration:"Release",
output_name:"#{ipaName}",
output_directory:"./build"
)
firim(firim_api_token:"#{firim_api_token}")
end
end
复制代码
cd到项目目录下,执行命令:
fastlane veronica
复制代码
打包上传成功
参考连接: