How to handle $(MARKETING_VERSION) of Xcode 11 by CI

Ichiro Hirata
2 min readDec 28, 2019

Since Xcode 11, CFBundleShortVersionString, which manages a release version number in Info.plist, is no longer a static value, but refers to $(MARKETING_VERSION) in the Build Settings; therefore, when the version changes in the Identity section on the General tab of the project editor, $(MARKETING_VERSION) is also modified.

Bundle version string, short in Info.plist

Issue

If you get the value from Info.plist in the same way as before, you cannot get the version number anymore, but literally $(MARKETING_VERSION) . In addition, you will probably be in trouble when you have to tag some specific points in a repository’s history for example. I suppose that is the point when using CI tools.

Solution (Shell Script)

In summary, you have to get the value from the Build Settings directly. It is not so difficult as you just do it by using the following single-line statement (cited from an answer on StackOverFlow).

When you use Bitrise…

You better off using the Script step. The following script is an example to set a release version number to an environment variable “GIT_TAG”.

fastlane Plugin

You are alternatively able to use fastlane-plugin-versioning and execute the lane command, as it has already supported $(MARKETING_VERSION) handling.

--

--

Ichiro Hirata

iOS Engineer@Fintech Company / WWDC19 Attendee / Passionate English Learner