Get app version from Cordova config.xml

cordova
#1

How would I get a value such as app version from the config.xml for a Cordova app?

<widget id="com.apps.myapp" version="1.2.3">

I see the correct version from this element in the Apps and Artifacts page after a build so I think it should be possible.

0 Likes

#2

Hey there @QubyMobile!

Please check out this thread: https://stackoverflow.com/questions/28304156/how-do-i-get-the-version-string-i-defined-in-the-config-xml :slight_smile:

0 Likes

#3

Thanks for the suggestion. I am not sure what to do with this, as I already have the version number displayed in my app.

I would like to name the build artifact filename in Bitrise using the version number found in the config.xml.

I need to somehow read it, and then put it into an environment variable in Bitrise so the next step can use it to name the output file.

0 Likes

#4

I’ll try once more. In the output from Deploy-to-Bitrise-io step I see this:

Deploying files
Uploading apk file: /Users/vagrant/deploy/app-release-bitrise-signed.apk
analyzing apk
apk infos: map[app_name:Toon min_sdk_version:21 package_name:[REDACTED] version_code:64090 version_name:3.63.2]
creating artifact
file size: 4MB
uploading artifact
finishing artifact

version_name.apk and version_name.ipa is what I would like to use to name the uploaded files, it seems strange that this value is not available.

toon.3.63.2.apk, toon.3.63.2.ipa

0 Likes