Using Cordova 3.5.0, when I run cordova prepare ios
it overwrites my build number as well as the app's version number, using the version string from config.xml
.
From:
<widget id="tld.domain.app" version="1.0.1"
It sets the CFBundleVersion the same as the short version:
So I have to keep manually keep resetting my build number to my format which is YYYYMMDD
.
Ideally I'd like it to either leave the build number alone, or be able to set it explicitly in the config.xml file.
Are either of these possible?
To see your macOS version and build numbers on a Mac, choose Apple > About This Mac and click the version number. In iOS or iPadOS, go to Settings > General > About and tap Software Version. For watchOS, in your iPhone's Watch app, go to General > About and look at the Version line.
Cordova for iOS projects can be opened in Xcode. This can be useful if you wish to use Xcode built in debugging/profiling tools or if you are developing iOS plugins. Please note that when opening your project in Xcode, it is recommended that you do NOT edit your code in the IDE.
Click the Xcode Cloud tab and choose Settings in the sidebar. Click the Build Number tab below Settings. Click the Edit button next to Next Build Number. Enter a new build number and save your changes.
I found the answer in this resolved issue.
There are separate versionCode
attributes (separate to version
) for iOS and Android, that need to be added to your config.xml file:
<widget ... android-versionCode="201406092" ios-CFBundleVersion="201406092"
This post here was a little clearer to me, a little more complete, so I mention it just in case it helps. Note that, effectively, it is almost the exact same as what Ade said. I only provide it because the first time I read Ade's answer, I was confused and did not fully understand his answer until I saw the answer below.
If you want to separate the build number from the version number, you can add the following attributes to the
widget
tag in your config.xml:version="VERSIONNR" android-versionCode="BUILDNR" ios-CFBundleVersion="BUILDNR"
so the complete tag, with those attributes included, looks something like this:
<widget id="APPID" version="VERSIONNR" android-versionCode="BUILDNR" ios-CFBundleVersion="BUILDNR" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
(text in uppercase are placeholders)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With