xcodemacrosbuild-settings

Where is the macro CURRENT_PROJECT_VERSION defined in Xcode?


This post How to set CURRENT_PROJECT_VERSION in xcode 8 says that setting is defined in the Build Settings, but how would I tell the name of the macro, such as CURRENT_PROJECT_VERSION from the Build Settings.


Solution

  • With Xcode 10.3 or bellow, the version and build numbers of the App were defined in the info.plist file as "Bundle version string, short" and "Bundle version" (key names if opened as Source Code are CFBundleShortVersionString and CFBundleVersion). With the proper setting, multiple targets would share the info.plist file and you could change the version/build for all targets in one single place

    With Xcode 11.1, each target defines the version/build numbers individually in the target Build Settings under "Marketing Version" and "Current Project Version" in the Versioning section

    The settings in the plist file are now pointing to the Build Settings with $(MARKETING_VERSION) and $(CURRENT_PROJECT_VERSION)

    So, as a summary:

    - App version

    Found in the info.plist as "Bundle version string, short" ("CFBundleShortVersionString" in the XML), that points with "$(MARKETING_VERSION)" to the Build Settings field named "Marketing Version".

    -App build number

    This is found in the info.plist as "Bundle version" ("CFBundleVersion" in the XML), that points with "$(CURRENT_PROJECT_VERSION)" to the Build Settings field named "Current Project Version".

    enter image description here The nice naming consistency is courtesy of Apple