Summary: How to use Agvtool to automatically update version numbers and Bulid versions Agvtool is a command-line tool that allows you to automatically increment these numbers to the next highest number or specific number. This document provides a step-by-step instruction to update your build and version numbers using Agvtool. The "Xcode" and "Command line" sections show the steps and command lines that are performed separately in Xcode. Important:when your app includes multiple targets,
agvtoolWould set the version numbers of all your targets to the same number.
Xcode:
You must complete your setup steps in the Xcode project.
Navigate to the Build Settings pane for your destination, and then update your build configuration as follows:
1. Modify the default settings for Xcode
By default, no version control system is used. Set up the version system Apple General ensures that Xcode will include all Agvtool version information generated in your project.
Figure 1: Setting build settings for the current project version and version control system
2. Set your version number and bulid version number set up your versions and build numbers.
This requires you to manually add a few items to figure out
Agvtool Query Application Info.plist Get your version and Bulid version number. It updates them, if they exist, does not do anything,
Otherwise. Make sure that CFBundleVersion ( Bundle version ) and CFBundleShortVersionString ( Bundle versions string, short ) keys are in your info.plist
As shown in 2. Info.plist Display
3. Next is the command line operation to update the version number
Exit Xcode, and then navigate to the directory that contains the project, and run the following command to apply the Agvtool property to the terminal.
3.1 Open terminal, CD project direct path such as project name XXX then CD/USERS/ITDEPT/DESKTOP/PRACTICE/XXX 3.2 Update version number to 2.0 enter command: $xcrun agvtool new-marketing -version 2.0 4. Update build number 4.1 automatically increases the command executed by your build number: $xcrun Agvtool next-version-all 4.2 Set a build number for your application, The command executed is $xcrun agvtool new-version-all 2.6.95. View version Numbers 5.1 View current version number execution: $xcrun agvtool what-marketing-v Ersion 5.2 View Current build number execution: $xcrun agvtool what-version
About Xcode's Agvtool command line