How to get package name via aapt

Hi everyone!

This article will be helpfull for everyone who need to get apk info without instalation.

To get total information run the following command

aapt dump badging <path_to_apk>

Use filters to get package and launchable activity

aapt dump badging <path_to_apk> | grep package | awk '{print $2}' | sed s/name=//g | sed s/\'//g
aapt dump badging <path_to_apk> | grep launchable-activity | awk '{print $2}' | sed s/name=//g | sed s/\'//g

If you need to get something else, for example label and icon from line application: label='AndroBench' icon='res/drawable-xxxhdpi-v4/icon.png' then you can create your custom filter as below

aapt dump badging <path_to_apk> | grep application: