Get minSdkVersion and targetSdkVersion from apk file

Viewed 12179

I am trying to get the values of minSdkVersion and targetSdkVersion from an apk stored on the device. Getting other details are discussed here, but only the targetSdkVersion is available in the ApplicationInfo class. Can the minSdkVersion be obtained other than by extracting the apk file and reading AndroidManifest.xml?

8 Answers

If you just need the minSdkVersion and targetSdkVersion and a whole lot of other details with the downloaded apk file. All you need is aapt tools and you can run the below command in the terminal.

aapt dump badging yourapk.apk

You can grep for sdkVersion for minSdk

aapt dump badging yourapk.apk | grep sdkVersion

Use the apkanalyzer shipped with the Android SDK:

apkanalyzer manifest target-sdk your.apk

apkanalyzer manifest min-sdk your.apk

Related