I have found a workaround for this problem by letting Xcode generate the Info.plist, then ignoring the CFBundleVersion key that it generates. I then ALSO supply a minimal explicit Info.plist file in Build Settings -> Packaging that only contains a single user defined MyBundleVersion key:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>MyBundleVersion</key>
<string>68</string>
</dict>
</plist>
Then I use PlistBuddy to increment MyBundleVersion instead of CFBundleVersion. and then reference the MyBundleVersion key in code:
let myBundleVersion = Bundle.main.infoDictionary?["MyBundleVersion"] as? String
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: