ADB Shell Command

本文详细介绍了如何使用ADB Shell命令来管理Android设备,包括列出已安装的包、获取系统信息、启动活动、模拟电池状态等。通过adb shell pm命令可以查看系统和第三方应用包,而adb dumpsys能提供系统信息、内存消耗、电池状态等详细数据。此外,还展示了如何模拟电池电量变化和调整设备时间。
摘要由CSDN通过智能技术生成

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.


                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值