Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
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?
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)
–
–
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.