I have a project set up with Tuist. We include an xcconfig
file with team and version informations.
The project runs just fine. The version informations we have set up in the xcconfig
file is shown in the targets “General” tab correctly.
Now, when I run the app and print a debug log message with the versions, I get a different value. This is how I log at the start of the app:
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
let appBuildVersion = Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? ""
RTLogger.misc.debug("App version: (appVersion), Build version: (appBuildVersion)")
Which prints this: App version: 1.0, Build version: 1
(which is the default information as if it had not been changed by the xcconfig
file.
Also, upon archiving, I get a build showing me these version numbers as well.
What am I missing here?