List Installed Package Names
Objective: List all the installed packages on an Android phone through an ADB shell.
Android package management is done by the pm command on the ADB shell. To list all the installed packages on an Android device, use the following syntax.
$ adb shell pm list packages
To list only the system packages, use the “-s” option.
$ adb shell pm list packages -s
To list only 3rd party (or non-system) packages, use the “-3” option.
$ adb shell pm list packages -3
To list the package names as well as the path to the installed APK files, use the “-f” option.
$ adb shell pm list packages -f
The “-f” option can be combined with the other options as well. For example, to list system package names with the installed package location, use the “-f -s” option.
$ adb shell pm list packages -f -s
To list all the disabled package names, use the “-d” option.
$ adb shell pm list packages -d
To list all the enabled package names, use the “-e” option.
$ adb shell pm list packages -e
adb shell am …
adb shell pm clear
Dump System Information
adb shell dumpsys battery set level XX (0-100)
adb shell dumpsys battery set status 3 (discharge)
adb shell dumpsys battery unplug
adb shell dumpsys battery reset
Getting system information (dumpsys)
adb shell dumpsys
The adb dumpsys command allows you to retain information about the Android system and the running applications.
To get currently memory consumption of an application you can use the following command.