apkanalyzer cannot parse the version name of my app

Viewed 156

In a pipeline, I would like to extract from an APK I build the following information:

  • the version name of my app
  • the version code of my app
  • the application id of my app

According to this documentation, I can use the apkanalyzer command line tool in order to extract these information from my APK file.

First, I tried to get all these information with this commande line:

./apkanalyzer apk summary 'my.apk'

But the result is not the one I expect:

unknown 0 ?

So, I tried to use the manifest verb instead of the apk one:

./apkanalyzer manifest version-code 'my.apk'

2011100022

The result is the one I want. So I tried:

./apkanalyzer manifest application-id 'my.apk'

com.my.package

The result is the one I want too. To finish, I tried:

./apkanalyzer manifest version-name 'my.apk'

?

As you can, the result is not the one I want.

I laso tried to display the whole manifest using the command line:

./apkanalyzer manifest print 'my.apk'

In the result, into the <manifest /> tag, I can see the following attributes and values:

  • android:versionCode="2011100022"
  • android:versionName="1.5.6-API-29"
  • package="com.mypackage

So as you see, all the needed information are correctly displayed into the manifest.

Note that the APK is a release one and all the information are also correctly displayed in the "apkanalyzer UI tools" in Android Studio:

enter image description here

So my question is: how can I display correctly the version name of my app using the apkanalyzer command line?

0 Answers
Related