Xcode:递增内部版本号 [英] Xcode: Increment build number

查看:195
本文介绍了Xcode:递增内部版本号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用一个脚本来创建时间戳,并替换应用程序的内部版本号.

We use a script that creates a time stamp and replaces the apps build number.

#!/bin/bash
echo "Update Build Number to Timestamp"
echo "--------------------------------"
# fail on error
set -e
agvtool new-version -all $(date +%Y%m%d%H%M%S)

这会将内部版本号更改为如下内容:201703241425.

This changes the build number to something like this: 201703241425.

我们在项目中引入了内部框架.

We introduced an in-house framework to our Project.

上面的命令还替换了框架Build的编号和Current Library Version.但是,构建失败并出现以下错误:

The command above also replaces the frameworks Build number and Current Library Version. However, the builds fail with the following error:

▸ Linking In-HouseFrameworkLayer

❌  ld: malformed 64-bit a.b.c.d.e version number: 201703241425
❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

当我将框架的BuildCurrent Library Version的格式更改为1.0.0并使用上述脚本进行的构建时,构建成功.

When I change the format for the framework's Build number, Current Library Version to 1.0.0 and do a build without using the script above, the builds are successful.

问题:如何为应用程序仅更改编号,但更改框架的Current Library Version编号?

Question: How can I change the Build number ONLY for the app, but NOT the framework Current Library Version number?

推荐答案

很明显,该应用程序使用CFBundleVersion + $(CURRENT_PROJECT_VERSION);库/框架应该使用(Current Library Version) + $(DYLIB_CURRENT_VERSION)

Obviously the app uses CFBundleVersion + $(CURRENT_PROJECT_VERSION); libraries/frameworks are supposed to use (Current Library Version) + $(DYLIB_CURRENT_VERSION)

默认情况下将其设置为$(CURRENT_PROJECT_VERSION),因此您需要将其更改为$(DYLIB_CURRENT_VERSION)字符串.

By default it is set to $(CURRENT_PROJECT_VERSION), so this is what you'll need to change to the $(DYLIB_CURRENT_VERSION) string.

重要:对于macOS应用,内部版本号必须单调增加,即使在不同版本之间也是如此.换句话说,对于macOS 您不能在不同版本中再次使用相同内部版本号的应用程序 火车. iOS应用没有此限制,您可以重复使用相同的应用 在不同的发布系列中再次建立编号.

Important: For macOS apps, build numbers must monotonically increase even across different versions. In other words, for macOS apps you cannot use the same build numbers again in different release trains. iOS apps have no such restriction and you can re-use the same build numbers again in different release trains.

版本号或内部版本号的值必须仅由."和数字组成,并且必须以数字开头和结尾.每个以句点分隔的整数值是版本的组成部分.您的版本号或内部版本号中的最大字符数不能超过18个字符.

iOS 版本号和内部版本号可能包含三个或更多组件,但是整个版本号或内部版本号的最大大小不能超过18个字符.

iOS version numbers and build numbers may have three or more components, but the maximum size of the entire version number or build number must not exceed eighteen characters.

macOS 应用比iOS应用更具限制性.对于macOS应用程序,三个组成部分之间以句点分隔的限制为上限,并且三个组成部分不得超过三个.

macOS apps are somewhat more restrictive than iOS apps. For macOS apps there is a limit of three components separated by periods and there may not be any more than three components.

版本号和内部版本

使用agvtool自动化版本和内部版本号

这篇关于Xcode:递增内部版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆