1、安装 Xcode command line tools:
xcode-select —install
2、安装fastlane
brew install fastlane
检查一下是否安装成功
fastlane --version
3、fastlane 初始化
首先需要cd到你的工程目录
然后执行以下代码
fastlane init
4、初始化选项
我选择是第4项
一直按Enter。
5、fastfile 文件配置
default_platform(:ios)
platform :ios do
desc "Description of what the lane does"
lane :custom_lane do
time = Time.new.strftime("%Y%m%d") #获取时间格式
version = get_version_number#获取版本号
ipaName = "Release_#{version}_#{time}.ipa"# 输出后的ipa的名字
gym(
scheme:"#####", #项目名称
export_method:"ad-hoc",#打包的类型
configuration:"Release",#模式,默认Release,还有Debug
output_name:"#{ipaName}",#输出的包名
output_directory:"~/Desktop"#输出的位置
)
api_key = "#####"
user_key = "#####"
pgyer(api_key:"#{api_key}",user_key:"#{user_key}")
end
end
6、安装蒲公英的 Fastlane 插件
fastlane add_plugin pgyer
7、打包上传到蒲公英
fastlane custom_lane
8、中间出现的问题
在上传的过程中出现以下错误:
Your real-name authentication information has not been face authentication yet, please authenticate now
翻译如下:
您的实名认证信息尚未进行正面认证,请立即进行认证
在蒲公英实名认证下就可以了。
再次执行
fastlane custom_lane
就可以了。