I know .apk files are .zip files, but AndroidManifest.xml looks binary and certainly grep or hex editors haven't been successful extracting the versionCode.
Does anybody know how to parse or extract it? I find myself in a Python script with the apks AndroidManifest.xml file open.
Assuming you have the Android SDK installed, you can use aapt to find this value. For example, on Linux:
aapt dump badging MyAwesomeApplication.apk |grep version