In order for agvtool to work properly you must first set
Project Settings / Build Settings / Versioning / Versioning System to Apple Generic.
- Create new shared scheme 'Bump Build Number'
- Add Build / Pre-Actions / Run Script action
- Paste code from given
bump-build.sh
script
Now, each time project is built with Bump Build Number scheme, build number will increase for all targets.
Also, automatically generated commit message will wait ready inside clipboard.
- Create new shared scheme 'Bump Version Number'
- Add Build / Pre-Actions / Run Script action
- Paste code from given
bump-version.sh
script
Now, each time project is built with Bump Version Number scheme, version number will be set to one from the script (change it there manually when needed) and build number will be reset to 1 - for all targets.