我知道有increment_version_number通道,但它会增加文件中放置的版本Info.plist。这意味着每次上传到 TestFlight 后,开发人员都必须Info.plist使用新版本更新文件。
另外,Fastlane 有get_version_number通道,但我无法使我的脚本工作,因为它无法像 2.4.1 那样用最后一位数字来增加版本。
那么,我如何才能对 TestFlight 中批准的版本(当前为 2.4.1 )进行+1(到最后一位数字)?
bal*_*630 10
如果您在 Testflight 中已有某个应用程序的上传,则必须增加 或Version number或Build number(或两者)。
可以Version number自动递增increment_version_number(如您所述),但您应该指定要递增的内容。\n在您的情况(v2.4.1)中:主要版本号是 2,次要版本号是 4,补丁是 1。
Fastfile因此,您应该在构建/归档应用程序之前添加此代码片段:
increment_version_number(\n bump_type: "patch"\n)\nRun Code Online (Sandbox Code Playgroud)\n\n但是,我不建议自动设置版本号,因为 app\xe2\x80\x99s 版本号取决于您在更新中提供的内容。如果它\xe2\x80\x99只是一个错误修复版本或性能优化,则增加patch. 如果您\xe2\x80\x99 添加了一些很酷的新功能,则应该增加版本minor。如果更新就像从头开始重写、完全重新设计或引入一些重大更改,那么我会增加major版本中的数字。总是增加数字并不优雅,patch因为版本号是有意义的。
在项目 I\xe2\x80\x99m 中,我们过去常常在发布时手动更改版本号,但Build numbers使用 Fastlane 自动增加版本号。
这是我们所做的:
\n\n1.) 在项目中启用 Apple 通用版本控制:(项目 > 构建设置 > 版本控制 > 版本控制系统:Apple Generic)
\n\n2.) 设置基本构建号:(项目 > 构建设置 > 版本控制 > 当前项目版本:1)
\n\n3.) 将以下简单的 Ruby 帮助程序类添加到 fastlane/utility 文件夹中:
\n\n变更日志_helpers.rb:
\n\nclass BuildNumberFactory\n class << self\n def make\n `git rev-list HEAD --count`\n end\n end\nend\nRun Code Online (Sandbox Code Playgroud)\n\n4.) 将此行添加到以下内容的第一行Fastfile:
Dir.glob(\'./utility/*\').each { |file| require file }\nRun Code Online (Sandbox Code Playgroud)\n\n5.) 用途FastFile:
lane :your_submit_testflight_lane do\n increment_build_number build_number: BuildNumberFactory.make\n # gym, pilot, other actions after setting the build number\nend \nRun Code Online (Sandbox Code Playgroud)\n\n此方法假设您使用 Git 进行版本控制。基本上,Fastlane 可以为每个提交分配一个特定的内部版本号。而且由于您上传的应用程序是递增的Build number,因此它不会成为一个Version number不会改变的问题。
当您\xe2\x80\x99即将发布该应用程序的更新时,我建议:
\n\n1.)在新提交中增加Version number(ex ),将其推送到远程2.4.2
2.) 为该提交创建一个 Git 标签
\n\n3.) 运行 Fastlane 通道,将构建上传到 Testflight
\n\n通过上述技术,开发人员在向 Testflight 提交每日测试版本时无需Version number一直更新 Info.plist。\n您只需Version number在发布更新时增加 - 您无论如何都无法避免这种情况。
希望能帮助到你!:)
\n