【问题标题】:AGVTool new-version and what-version do not correspondAGVTool new-version 和 what-version 不对应
【发布时间】:2012-07-31 09:46:04
【问题描述】:

当我这样做时:

agvtool new-version -all 99

它会更新我的 Info.plist 文件。但是,如果我这样做:

agvtool what-version

agvtool next-version

我收到此错误:

There does not seem to be a CURRENT_PROJECT_VERSION key set for this project.
Add this key to your target's expert build settings.

为什么这不对应。我是否必须使用 plist 命令行工具才能检索我的应用程序的当前版本。奇怪的是agvtool what-marketing-version 工作正常。具有讽刺意味的是,agvtool 本身似乎没有版本;-)

【问题讨论】:

标签: iphone ios xcode cocoa-touch agvtool


【解决方案1】:

这个链接对我有用Technical Q&A QA1827 Automating Version and Build Numbers Using agvtool

链接如下。这有助于解决我开始使用 agvtool 时的问题。

  1. 启用agvtool。

导航到目标的“构建设置”窗格,然后针对所有构建配置对其进行更新。

将当前项目版本设置为您选择的值。我将我的设置为 1

将版本控制系统设置为 Apple Generic。

默认情况下,Xcode 不使用任何版本控制系统。将版本控制系统设置为 Apple Generic 可确保 Xcode 将所有 agvtool 生成的版本信息包含在您的项目中。

  1. 设置您的版本和内部版本号。

agvtool 在您的应用程序的 Info.plist 中搜索您的版本和内部版本号。如果它们存在,它会更新它们,否则什么都不做。确保您的 Info.plist 中存在 CFBundleVersion(Bundle 版本)和 CFBundleShortVersionString(Bundle 版本字符串,短)键

【讨论】:

  • 如果您希望使用 agvtool 作为运行脚本构建阶段的一部分来自动增加每个构建或存档的构建编号,请不要走这条路。这将静默取消构建,因为 agvtool 会更改项目文件。希望我在那里节省了 10 分钟。
  • @AdamEberbach 你刚刚为我节省了好几个小时。谢谢。
猜你喜欢
  • 2022-06-20
  • 1970-01-01
  • 2011-04-11
  • 2020-03-04
  • 1970-01-01
  • 1970-01-01
  • 2012-12-09
  • 2022-01-08
  • 2012-05-28
相关资源
最近更新 更多