fastlane iOS打包 安装与使用
1、安装 fastlane
sudo gem install fastlane
或者
brew install fastlane
2、进入工程目录下 终端输入 fastlane init 接着输入3 然后control + c退出 接着编写 Fastfile文件
【钉钉】 Fastfile文件
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 lane :fir do time = Time.new.strftime("%Y%m%d") #获取时间格式 version = "1.0.0"#获取版本号 ipaName = "Debug#{version}_#{time}.ipa" gym( scheme:"QingTeng", #项目名称 # export_method:"app-store",#打包的类型 ad-hoc export_method:"ad-hoc",#打包的类型 configuration:"Debug",#模式,默认Release,还有Debug output_name:"#{ipaName}",#输出的包名 output_directory:"~/Desktop/Ipa",#输出的位置 # clean: true, # include_symbols:false, # include_bitcode:false ) firim(firim_api_token: "fir的token",app_changelog:"版本更新") din end lane :din do dingTalk_url = "https://oapi.dingtalk.com/robot/send?access_token=钉钉的token" markdown = {"at": { "atMobiles":[ "要at的人的电话","要at的人的电话" ],"isAtAll": false},"msgtype": "text","text": {"content":"iOS已更新 可以加更新地址等信息"}} uri = URI.parse(dingTalk_url) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request.add_field('Content-Type', 'application/json') request.body = markdown.to_json response = https.request(request) end end
飞书-【优化版】
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 lane :pg do |options| time = Time.new.strftime("%Y%m%d") #获取时间格式 version = "1.0.0"#获取版本号 ipaName = "Debug#{version}_#{time}.ipa" gym( scheme:"Lilycash", #项目名称 # export_method:"app-store",#打包的类型 ad-hoc export_method:"ad-hoc",#打包的类型 configuration:"Debug",#模式,默认Release,还有Debug output_name:"#{ipaName}",#输出的包名 output_directory:"~/Desktop/Ipa",#输出的位置 # clean: true, # include_symbols:false, # include_bitcode:false ) pgyer(api_key: "蒲公英key", update_description: options[:desc]) fs options end lane :fs do |options| dingTalk_url = "飞书自定义机器人地址" markdown = { "msg_type": "post", "content": { "post": { "zh_cn": { "title": "安装包更新通知", "content": [ [{ "tag": "text", "text": options[:desc] }, { "tag": "a", "text": "下载地址", "href": "https://www.pgyer.com/****" } ] ] } } } } uri = URI.parse(dingTalk_url) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request.add_field('Content-Type', 'application/json') request.body = markdown.to_json response = https.request(request) end end
4、安装蒲公英或者fir插件
fastlane add_plugin pgyer
fastlane add_plugin firim
5、最后终端输入 fastlane fir 即可进行打包上传到fir 并通知到钉钉
飞书使用 【fastlane fs desc:更新了***】
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
2020-02-09 iOS 线程同步 NSLock、NSRecursiveLock、NSCondition、NSConditionLock