3.右键我的电脑->属性->高级系统设置->环境变量->编辑系统变量的path->添加adb文件夹的路径
adbversion
查看adb版本
adbconnect127.0.0.1:21503
连接逍遥模拟器
adbdevices
设备/模拟器的连接状态
adbget-state
获取设备连接状态
adbshellpmlistpackages
查看手机上应用包名
安装软件路径
卸载已安装的应用
adbshellpmpath<包名>
打印指定包名的路径
adbshell
进入手机
exit
退出手机
adbpush文件位置\文件名/sdcard/
电脑上文件发送到手机设备上
adbpull/sdcard/文件名d:/
将手机上的文件传送到我们的电脑上
adbshellgetpropro.build.version.release
查看手机系统版本信息
adbget-serialno
获取设备序列号
adbstart-server
启动adb服务
adbkill-server
关闭adb服务
adblogcat
查看和跟踪系统日志
adblogcat-f/sdcard/test.txt
将日志输出到文件
adblogcat-vtime>电脑路径/文件名
抓取日志导入电脑
adblogcat-c
清理已存在的日志
throttle300延迟
-s
伪随机数生成器的seed值
ignore-crashes
忽略崩溃
gnore-timeouts
忽略超时
ignore-security-exceptions
忽略安全异常
kill-process-after-error
发生错误后直接杀掉进程
adb报告分析
adbshelltop
查看手机进程信息
adbshelltop|findstr包名
查看单个程序pid
adbshelldumpsyswindow|findstrmCurrentFocus
获得当前应用的包名及activity
adbshellamstart-W-n包名/活动
冷启动
adbshellamforce-stop包名
冷启动停止
home键返回adbshellinputkeyevent3
先打开app后台运行adbshellamstart-W-n包名/活动
热启动
adbshellps
adbshellcat/proc/15320/net/dev
查看流量
adbshelldumpsysbattery
adbshelldumpsysbatterysetstatus1
adbshellpmclear<包名>
清除软件缓存
adbreboot
重启手机
adbkill-serveradbstart-server
adb-s
adbpush<电脑文件路径><手机路径>adbpull<手机路径><电脑文件路径>
adbpush<电脑文件路径><手机路径>adbshellpminstall-f<手机路径>
adbshellamstart-W-Spackage/activityadbshellamforce-stoppackage
adbshellpmlistpackage-fkeywordadbshellpmlistpackage-3keywordadbshellpmlistpackage-ikeyword
adbshellscreencap<手机地址>adbshellscreenrecord<手机地址>
adbshelldumpsysmeminfopackageadbshelldumpsyscpuinfo|findstrpackage
从本地复制文件到模拟器
adbpush本地文件路径模拟器路径
adbshellcat/proc/PID编号/net/dev查看到流量记录文档
wlan0表示wifi流量
lo表示本地流量
receive表示接收数据流量
transmite表示发出数据流量
1.有Monkeyfinished关键字
-p包名必写
没有-v开始和结束的日志提醒
-v-v-v提示所有手机内日志信息
--ignore-crashes忽略崩溃
--ignore-timeouts忽略超时
--pct-touch点击动作
--pct-motion滑动操作
--pct-trackball点击加滑动
--pct-syskeys系统按键
--pct-anyevent任何事件
--pct-appswitchapp切换
adbshellmonkey-pcom.youdao.calculator-v--throttle500--pct-anyevent100500
-p:后面加的是包名
adbshellmonkey-pcom.youdao.calculator-pcom.moji.mjweather--throttle300--pct-touch80--pct-anyevent10--pct-appswitch10500>monkeyTest.txt