How to retrieve a value from aapt dump badging?

Hi Team,

I want to read the versionName and versionCode from “aapt dump badging” output; I guess, appium is executing this command to retrieve all the resources information while starting a driver.

Is there any way i can fetch above information runtime?

Command:
aapt dump badging XYZ.apk

output:
package: name=‘com.abc.xyz’ versionCode=‘100000’ versionName=‘1.0.0.0’ platformBuildVersionName=‘a.b.c’
install-location:‘ABC’
sdkVersion:‘19’
targetSdkVersion:‘23’

Since your apk is likely local to the same machine where you are running the appium client, you could just execute system() or the equivalent in whatever language you are using.

Thanks @willosser for quick response.

I can do the system() call and read the output but was thinking is there any where appium is storing “aapt dump badging” output. It will be cleaner and optimize (consider appium is executing “aapt dump badging” during server initialization)