从零开始devops-fastlane配置
https://www.jianshu.com/p/db5fe7fed9f3
https://blog.csdn.net/l7022995/article/details/79321924
https://www.jianshu.com/p/840943eff17b
# 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"
schemeName = "iOS_CI_Test"
outputpath = "../output/#{schemeName}_dev"
desc "Archive Dev"
lane :dev do
# update_project_provisioning(
# profile: "./provisions/wangyuhengtest.mobileprovision",
# build_configuration:"Debug")
gym(scheme: schemeName,
#没有workspace的话,使用 project: "#{schemeName}.xcodeproj" 替换下面👇
workspace: "#{schemeName}.xcworkspace",
export_method:"development",
configuration: "Debug",
output_directory: outputpath,
silent: true)
end
lane :adhoc do
# update_project_provisioning(
# profile: "./provisions/wangyuhengtest.mobileprovision",
# build_configuration:"Debug")
gym(scheme: schemeName,
#没有workspace的话,使用 project: "#{schemeName}.xcodeproj" 替换下面👇
workspace: "#{schemeName}.xcworkspace",
export_method:"ad-hoc",
configuration: "Release",
output_directory: outputpath,
silent: true)
end
# lane :custom_lane do
# # add actions here: https://docs.fastlane.tools/actions
# end
end
打包脚本
# You can define as many lanes as you want
desc "Deploy a new version to the App Store"
lane :release do |op|
increment_version_number(version_number: op[:version]) #根据入参version获取app版本号
increment_build_number(build_number: op[:version]) #将build号设置与app版本号相同
# 设置app的info.plist文件项
set_info_plist_value(path: "./xxx/Info.plist", #info.plist文件目录
key: "UIFileSharingEnabled", # key,将plist文件以Source Code形式打开可查询对应的key
value: false) # value
# 设置自定义plist文件项,用于给app配置不同的服务器URL
set_info_plist_value(path: "./xxx/hostAddress.plist",
key: "host",
value: "https:/zhengshiServer:xx/xxx/xxx")
# 设置某些服务是否有效
# 还可以使用modify_services,具体参考官网相关文档
produce(
enable_services:{
push_notification: "on",
}
)
# 更新Provisioning Profile
# 在项目当前目录下创建provisions文件夹,并将App Store版本的.mobileprovision文件保存在里面,名称随意。
update_project_provisioning(profile: "./provisions/appstore.mobileprovision")
# 更新项目团队
update_project_team(path: "xxx.xcodeproj",
teamid: "5JC8GZ432G")
# 开始打包
gym(# use_legacy_build_api: true, # Xcode 9之后,需要去掉
output_name: "appstore", # 输出的ipa名称
silent: true, # 隐藏没有必要的信息
clean: true, # 在构建前先clean
configuration: "Release", # 配置为Release版本
codesigning_identity: "iPhone Distribution: xxx Co.,Ltd. (5JC8GZ432G)", # 代码签名证书
buildlog_path: "./fastlanelog", # fastlane构建ipa的日志输出目录
export_method: "app-store", # Xcode 9增加export_method标签
output_directory: "/Users/xxx/Desktop") # ipa输出目录
end
desc "Build a new version use the ceshi"
lane :ceshi do |op|
increment_version_number(version_number: op[:version])
increment_build_number(build_number: op[:version])
set_info_plist_value(path: "./xxx/Info.plist",
key: "UIFileSharingEnabled",
value: true)
set_info_plist_value(path: "./xxx/hostAddress.plist",
key: "host",
value: "https:/ceshiServer:xx/xxx/xxx")
# 设置某些服务是否有效
# 还可以使用modify_services,具体参考官网相关文档
produce(
enable_services:{
push_notification: "off",
}
)
# 将Development版本的.mobileprovision文件保存在里面,名称随意。
update_project_provisioning(profile: "./provisions/development.mobileprovision")
update_project_team(path: "xxx.xcodeproj",
teamid: "5JC8GZ432G")
gym(# use_legacy_build_api: true,
output_name: "ceshi",
silent: true,
clean: true,
configuration: "Debug",
buildlog_path: "./fastlanelog",
codesigning_identity: "iPhone Developer: xxx (xxxxxxxxxx)",
export_method: "development", # Xcode 9增加export_method标签
output_directory: "/Users/xxx/Desktop"
)
end
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端