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?

aapt dump badging XYZ.apk

package: name=‘’ versionCode=‘100000’ versionName=‘’ platformBuildVersionName=‘a.b.c’

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)