Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 589
Daniel Brower Avatar asked Jan 29 '19 16:01

Daniel Brower


People also ask

Where is build settings in Xcode?

Choose the project in the Project Navigator on the left. Select the Configurations target from the Targets section and click the Build Settings tab at the top. The Build Settings tab shows the build settings for the Configurations target. It's possible to expand this list with build settings that you define.

What is Built_products_dir?

BUILT_PRODUCTS_DIR. Description: Directory path. Identifies the directory under which all the product's files can be found. This directory contains either product files or symbolic links to them.

What is CFBundleShortVersionString?

CFBundleShortVersionString is the external user facing release version of your app displayed in the App Store. It must follow the {major}. {minor}. {patch} version format of three period separated integers. This must be incremented every time you release a version to the App Store.


1 Answers

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

like image 56
eharo2 Avatar answered Sep 28 '22 08:09

eharo2