How to get apk information without having to install it on the device

If you want to know certain information such as VersionName and VersionCode of an apk which is on your machine without having to install the app onto your device you can easily find this out by using aapt. aapt is a tool which comes when installing the android sdk.

Once you have the android sdk installed open up your command prompt and navigate to the Android\sdk\build-tools\[api] folder, this should be where aapt lives (in my case I have it in C:\Users\Hadi\AppData\Local\Android\sdk\build-tools\22.0.1). Alternatively you can go to the folder manually then hold down the Shift key and right click on the screen, this will allow you to select the “Open command window here” option. Once you have navigated to that folder run the following command replacing myapp.apk with your own apps name and location:

aapt dump badging myapp.apk

In my case if I wanted to view information about my own app I would run this command:

aapt dump badging C:\Users\Hadi\Downloads\hadi.apk

package: name='khaleghi.hadi' versionCode='10' versionName='1.0' platformBuildVersion
Name='5.1.1-1819727'
sdkVersion:'17'
targetSdkVersion:'22'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.DOWNLOAD_WITHOUT_NOTIFICATION'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.REBOOT'
uses-permission: name='android.permission.CHANGE_COMPONENT_ENABLED_STATE'
uses-permission: name='android.permission.ACCESS_CACHE_FILESYSTEM'
uses-permission: name='android.permission.DEVICE_POWER'
uses-permission: name='android.permission.GET_TASKS'
uses-permission: name='android.permission.STATUS_BAR'
uses-permission: name='android.permission.RECEIVE_BOOT_COMPLETED'
uses-permission: name='android.permission.DISABLE_KEYGUARD'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.UPDATE_DEVICE_STATS'
uses-permission: name='android.permission.CHANGE_WIFI_STATE'
uses-permission: name='android.permission.ACCESS_DOWNLOAD_MANAGER'
application-label:'hadi updates'
application-icon-160:'res/drawable-hdpi-v4/ic_launcher.png'
application-icon-240:'res/drawable-hdpi-v4/ic_launcher.png'
application-icon-320:'res/drawable-xhdpi-v4/ic_launcher.png'
application-icon-65535:'res/drawable-xhdpi-v4/ic_launcher.png'
application: label='hadi updates' icon='res/drawable-hdpi-v4/ic_launcher.png'
application-debuggable
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-implied-permission: name='android.permission.READ_EXTERNAL_STORAGE' reason=
'requested WRITE_EXTERNAL_STORAGE'
feature-group: label=''
uses-feature: name='android.hardware.touchscreen'
uses-implied-feature: name='android.hardware.touchscreen' reason='default feat
ure for all apps'
uses-feature: name='android.hardware.wifi'
uses-implied-feature: name='android.hardware.wifi' reason='requested android.p
ermission.ACCESS_WIFI_STATE permission, and requested android.permission.CHANGE_
WIFI_STATE permission'
provides-component:'launcher'
main
other-activities
other-receivers
other-services
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--'
densities: '160' '240' '320' '65535'