adb 命令搜集

adb devices 用来获取手机的设备号:

adb devices
List of devices attached
CLB0218614003433    device

adb -s 设备号    用来操作指定的设备:

adb -s CLB0218614003433 logcat

启动adb server 的命令:

adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully

停止adb server的命令:

adb kill-server

查看adb 的版本:

adb version
Android Debug Bridge version 1.0.41
Version 29.0.4-5871666

重新启动手机端的命令:

adb reboot

安装apk的命令:

adb install c://xx.apk

覆盖安装apk的命令:

adb install -r c://xx.apk

卸载apk的命令:

adb uninstall 包名

Android本身就是一个 Linux 的 shell,可以调用 Android 内置命令 

adb shell

查看手机应用列表:

adb shell pm list packages

清除程序的缓存和数据

adb shell pm clear 包名

查看当前的activity:

adb shell dumpsys window | grep mCurrentFocus

获取当前界面元素 :

adb shell dumpsys activity top

获取任务列表 :

adb shell dumpsys activity activities

启动应用:

adb shell am start -n 包名 -S

注:-S表示启动程序时先会清除缓存如没有这个参数则不会清除程序缓存及数据

查看日志:

adb logcat -v time | grep(findstr) "关键字"

清空日志:

adb logcat -c

查看手机运行的程序:

adb shell ps

查看内存信息:

adb shell dumpsys meminfo 

查看cpu信息:

adb shell dumpsys cpuinfo

获取特定包的基本信息:

adb shell dumpsys package 包名

获取系统的通知:

adb shell dumpsys notification

查看app的入口信息:

adb logcat | grep -i displayed
posted @ 2019-10-25 15:10  蚂蚁KO大象  阅读(250)  评论(0)    收藏  举报