I. Conceptual description: The difference between build and version
There are two versions in iOS, the so-called version number and the build number, as shown in:
We use the simplest language to distinguish between these two version numbers and the use of the following:
- Version number: Also known as bundle versions string, Sthort. AppStore and itune The version number used in the product introduction, multi-user-oriented, mostly two-segment or three-segment, 1.0.1,1.2, etc., usually as the main basis for version upgrade
- Build number: Also known as bundle version. Internal use of the developer team, easy to track down the bug, more used in the mid-beta process to distinguish different products. In the same version, the build number can be different
They are also represented in plist by different fields.
For developers, we tend to focus more on the build number, which is the bundle version. Therefore, the purpose of this paper is to introduce a method to realize the automatic tagging of bundle version to distinguish different products in beta.
Second, the Bundle version automatically increased
There are many ways to express Bundle version, roughly as follows: time notation (e.g. 20150715), letter notation, pure digital notation. In this paper, we use the last pure numeral notation and use Xcode to compile the code as bundle version. Predictably, such bundle version will show an incremental trend. But do you need to modify Xcode's engineering settings and plist every time you compile? The answer is in the negative. Apple has provided tools to help us automate the increment of bundle version.
Specific setup steps to participate (Pictures reproduced from here):
The script code is:
Xcrun Agvtool Next-version-all
Third, more
In the case of multi-person development, there will be multiple compilations of the branches developed by each person resulting in a build version that is not allowed, but does not affect the development process. For development we need to be aware of the build version before each test test. Make sure it increases, just, yes! As to whether to increase the release, whether the need for manual modification, this can be adjusted according to the actual situation. After all, the build version number is just an auxiliary parameter.
Original article, reproduced please indicate the program small Weng @ Blog Park, mail [email protected], welcome you and I in the c/c++/objective-c/machine vision and other fields to start communication!
"Original" set iOS project Buildversion automatically added