There are lot of questions about increment the build number in xcode, e.g.
Xcode-Increment build number only during ARCHIVE?
https://pontifex.azurewebsites.net/xcode-auto-increment-build-on-archive/
https://gist.github.com/sekati/3172554
I also follow same thing and its works fine when I do the release/debug. But when I do the archives I could not get incremental version numbers. Please see below pic for your reference.
I tried below scenarios
- I wrote script in build phase
- I wrote script in edit scheme->target->archive->pre action/post action
None of above will updating build version in archives. But after archives I have notices info.plist file in xcode project was updated with correct version number but If I open organizer and see archive it showed me old build number.
Note: In pic I have assign buildNumber as static during testing if I changed this version number still it does not updating during archive process.
Let me know if I am missing something here?