agvtool doesn't update extension Marketing Version

We have a bit of a complicated build process and need to build the Widget outside of our main app and repackage since we are using a cross platform framework. I tried scripting out updating my Widget's Marketing Version but agvtool won't update the MARKETING_VERSION in the project.pbxproj file. Therefore, we end up getting these emails from Apple:

ITMS-90473: CFBundleShortVersionString Mismatch - The CFBundleShortVersionString value ‘1.2.2’ of extension ‘MyiOSApp.app/PlugIns/widgetExtension.appex' does not match the CFBundleShortVersionString value ‘1.2.3' of its containing iOS application ‘MyiOSApp.app'.

I run this and it says it's updating in the Widget plist (but not the project.pbxproj) so when I build with xcode via command line it doesn't update and when we submit to the App Store we get the above message from Apple:

/usr/bin/agvtool new-marketing-version $(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ../My.Crossplatform.App/My.Crossplatform.App.iOS/Info.plist)
Setting CFBundleShortVersionString of project ios to: 
  1.2.3.

Updating CFBundleShortVersionString in Info.plist(s)...

Cannot find "ios.xcodeproj/../YES"
Updated CFBundleShortVersionString in "ios.xcodeproj/../widget/Info.plist" to 1.2.3

I've had to resort to manually updating then submitting every time. What is the correct way to update the MARKETING_VERSION in the project.pbxproj file in a CI environment using bash?

Replies

Hi. Have you figured this ../YES thing out?

Haha... asked and then remembered --- need to set GENERATE_INFOPLIST_FILE to NO in order for this to work.

Check this thread on using build configuration files to externalise versions for easier updating by your own scripts: https://developer.apple.com/forums/thread/709065?answerId=718911022#718911022