清空adb:
cls
屏幕截图并保存到电脑
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png .\screen.png
push AAA文件夹到sdcard
adb push AAA/ /mnt/sdcard/
导出logcat日志
adb logcat > d:\logcat.txt
打印日志:
把以下内容写成一个bat文件
del log.txt.xml
adb logcat -c
adb logcat -v threadtime > log.txt.xml
报错: daemon not running. Starting it now at tcp:5037
解决方法:
1、输入命令adb nodaemon server
2、输入命令后不要关闭窗口,重新打开一个cmd,adb就能正常
查询已安装的应用
adb shell pm list packages
adb shell pm list packages|findstr “pdf” 【查询已安装的应用,并找出包含 pdf 的内容】
adb sell
pm list package | grep -i mopria 打印包名
dumpsys activity | grep -i run
安装应用
adb install -r -t C:\test.apk
卸载应用
adb uninstall com.joey.pdf(apk包名)
打印apk 版本相关信息
adb shell dumpsys package com.joey.pdf
adb shell dumpsys package com.joey.pdf|findstr “version”
打印当前页面信息
adb shell dumpsys activity activities|findstr “mCurrent”
adb shell dumpsys activity activities|findstr “ActivityComponent”
d
umpsys activity activities > activities.txt
通过adb 打开页面
adb shell am start -n com.joey.pdf/com.joey.pdf.ui.QSActivity
monkey
adb shell monkey -p com.Autel.maxi --pct-motion 25 --pct-appswitch 10 --pct-rotation 5 -s 12358 --throttle 400 --ignore-crashes --ignore-timeouts --pct-syskeys 0 -v 500000
杀掉进程
adb shell am force-stop com.joey.pdf
查询屏幕分辨率
adb shell wm size
获取物理密度Physical density:adb shell wm density (輸出Physical density:320 — 即屏幕密度为320dpi)
修改物理密度Physical density:adb shell wm density 280
恢复设置:adb shell wm density reset
打印所有进程
adb shell ps