agvtool new-marketing-version doesn't work on Xcode 13
Asked Answered
B

2

7

Since Xcode 13, there is no Info.plist by default. Instead, the common field are in the target’s Info tab, and build settings in the project editor. A separated Info.plist file is added to project only when there are additional fields.

When I run the following command to set MARKETING_VERSION on Jenkins

$ xcrun agvtool new-marketing-version 1.0.0

It doesn't have any effect on Info.plist file unless the key CFBundleShortVersionString exists. But every time I update field in target's Info tab, the Info.plist file seems to be regenerated again and CFBundleShortVersionString disappear.

Therefore, I'm wondering is there any suggestion about how to setting MARKETING_VERSION via command line or how to use agvtool in this case. Any suggestion would be appreciated!

Brent answered 9/6, 2022 at 10:46 Comment(1)
Unfortunately, I have the same issue and so far could not figure out what makes Xcode regenerate the plist file.Physostomous
S
9

Indeed, in Xcode 13 agvtool has trouble to update marketing version. In order to "fix" it, set GENERATE_INFOPLIST_FILE to NO in Build settings. This will prevent Xcode to generate the Info.plist automatically. Then create your own Info.plist with the same values and it should works.

Maxime

Stearoptene answered 20/6, 2022 at 14:51 Comment(2)
The problem is that even if you set GENERATE_INFOPLIST_FILE to NO, MARKETING_VERSION is no longer in the Info.plist file, but in the project file and so does not get updated.Malcolm
add Info.plist, copy values from generated to new,add path to the new Info.plist in build settings,generate plist -> NO, make sure you are not copying it to target (because it is processed and than copied, you would have error that it is done twice), than xcrun agvtool new-marketing-version 1.2.3 <-new test version works, it does update correct field.Regen
S
0

If you set GENERATE_INFOPLIST_FILE to NO in Build settings, it will throw you the next error: Cannot find "ABC.xcodeproj/../NO when using agvtool to update the marketing version. The only way I could find to fix this was to manually delete from project.pbxproj all the GENERATE_INFOPLIST_FILE lines.

Sternberg answered 8/12, 2023 at 20:5 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.