1、两种连接安卓设备的方式
1、使用usb线连接安卓设备和电脑,在安卓设备中打开开发者模式,打开usb调试
2、使用wifi远程连接安卓设备,需要保证电脑和安卓设备在同一个网段,在安卓设备中打开开发者模式,并且在开发者选项中同时打开usb调试以及无线调试
2、使用AndroidStudio来查看日志
3、使用adb命令也能查看日志
连接wifi设备
adb connect 192.168.37.115:40827
指定对应设备
adb -s 544a0231fe74d601
adb -s 192.168.37.115
查看设备上的进程
adb shell top
查看对应进程的日志
adb logcat --pid=[id]
Monkey测试命令
adb shell monkey -p com.speediance.speediance_mobile -s 5 --throttle 300 --pct-syskeys 0 --pct-touch 60 --pct-motion 30 --ignore-security-exceptions -v -v -v 1000000 >C:\Users\Administrator\Desktop\monkey.log
进入Shell 模式以及退出
adb shell
su
exit
设置屏幕亮度
adb shell
settings put system screen_brightness 5000
返回桌面
adb shell am start -n com.android.launcher3/.Launcher
adb shell input keyevent 3
截图当前安卓设备的并保存到电脑上
adb exec-out screencap -p > C:/finish.png
查看当前安卓设备蓝牙状态
adb shell settings get global bluetooth_on
4、常用测试工具
MUMU模拟器(模拟器多开/视频录制/操作录制)、Pycharm(小工具) 、Qnet(模拟弱网)、Fiddler (抓包模拟弱网)、AndroidStudio(看日志、监控设备性能和资源使用情况)、Anlink(远程控制)、火绒安全(模拟弱网)、小米WIFI(访客模式限速模拟弱网)