adb重连
- adb kill-server
- adb start-server
日志抓取
1、adb logcat>1.log
2、adb bugreport
3、adb shell dumpsys dropbox --print >>1.log
pull/push文件
adb pull ./sdcard/cxx.trace
adb push xxx ./sdcard
获取应用版本名/版本号
adb shell dumpsys package com.baidu.haokan | grep versionName
adb shell dumpsys package com.baidu.haokan | grep versionCode
adb shell screenrecord --bugreport /sdcard/launch.mp4 录制屏幕
adb pull /sdcard/launch.mp4
adb shell pm list package
17.截屏并保存至 sdcard 目录:
adb shell screencap -p /sdcard/screen.png
18.录制视频并保存至sdcard:adb shell screenrecord sdcard/record.mp4,执行命令后操作手机,ctrl + c 结束录制,录制结果保存至 sdcard:
adb shell screenrecord sdcard/record.mp4
19.获取设备分辨率:adb shell wm size
adb shell wm size
20.列出指定应用的 dump 信息:adb shell pm dump 包名
adb shell pm dump
21.列出对应包名的 .apk 位置:adb shell pm path 包名
adb shell pm path
22.查看当前终端中的进程信息:adb shell ps
adb shell ps
23.monkey测试:adb shell monkey –p 程序包 –v 测试次数 ,比如“adb shell monkey –p com.htc.Weather –v 20000”意思是对com.htc.Weather 这个程序包单独进行一次20000次的monkey测试
adb shell monkey –p 程序包 –v 测试次数
24.显示所有程序包:
adb shell ps | grep [process]
25.根据进程pid或包名查看进程占用的内存
adb shell dumpsys meminfo
adb shell dumpsys meminfo<package_name>
26.Android 代码设置调试等待
adb shell am set-debug-app -w --persistent packagename
–persistent 持久,如果没有这个选项,就只有一次调试等待。如果有,以后每次启动app 都会有。
如果想要清楚,就adb shell am clear-debug-app
27停止运行APP
adb shell am force-stop com.xiaomi.micolauncher