I have found a few other posts that show how to add a script to increment the build number with a script:
Better way of incrementing build number?
Xcode project's "Build number"
Can Xcode insert the version number into a library's filename when building?
But what I want to do, is only increase the build number when I use ARCHIVE (both before and after).
Example: If current build number is 21, then when I choose Product > Archive the build number will be increased to 22, it will go through its process of building and creating the Archive file with the build number of 22, and then when it is finished archiving, it will increase the build number to 23.
See Question&Answers more detail:os