I found a solution that worked for me.
I used the two scripts from this git hub repo:
https://gist.github.com/sekati/3172554
For the build number - once this number is just to keep track of my builds I added it to the pre-actions of my build scheme like so:
- Edit Scheme
- Expand "Build" section by clicking disclosure triangle
- Select "Pre-actions"
- Add "New Run-Script Action"
- Select "Provide build settings from $YOUR_PROJECT"
- Add an increment script
This increments the build number every time I build / Run the app.
Then for the version number - I wanted this only to increment when I archive. As this is the stage where I release the app to testers or App store and thus, its important to keep an accurate version number.
To do this:
- Edit Scheme
- Expand "Archive" section by clicking disclosure triangle
- Select "Pre-actions"
- Add "New Run-Script Action"
- Select "Provide build settings from $YOUR_PROJECT"
- Add an increment script
Hope this helps others.