Windows10搭建adb测试环境
https://blog.youkuaiyun.com/omaidb/article/details/116599234
使用adb命令进行monkey测试
# 只对指定包名进行测试
adb shell monkey -p pkgname
# 指定事件之间的间隔时间,单位是毫秒
adb shell monkey --throttle milliseconds
# 伪随机数生成器的seed值,如果用相同的seed值再次运行Monkey,它将生成相同的事件序列
adb shell monkey -s seed
# 指定日志级别
adb shell monkey -v[-v -v]
# 指定触摸时间的百分比percent
adb shell monkey --pct-touch
# 指定动作时间的百分比percent
adb shell morkey --pect-motion
# 指定轨迹球时间百分比percent
adb shell monkey --pect-trackball
# 指定基本导航时间百分比percent
adb shell monkey --pct-nav
# 设定主要导航事件百分比percent,兼容中间键,返回键,菜单按键
adb shell monkey --pct-majornav
# 设定系统事件百分比percent,比如home,back,拨号及音量调节键等事件
adb shell monkey --pct-syskeys
# 设定启动不同应用程序的事件百分比percent
adb shell monkey --pct-appswitch
# 设定不常用事件的百分比
adb shell monkey --pct-anyevent
# 忽略崩溃和异常事件
adb shell monkey --ignore-crashes
# 设置不需要进行测试的黑名单应用
adb shell monkey --pkg-blacklist-file
# 设置需要进行测试的白名单应用
adb shell monkey --pkg-whitelist-file
解决原生安卓WiFi感叹号
一般禁用captive portal
即可。
# 进入adb shell
adb shell
# 将Android设备的全局captive_portal_mode参数设置为0,这样设备就不会自动跳转到登录页面
## captive_portal_mode 是一个网络参数,当它被激活时,Android 设备会检测网络连接是否需要登录或者同意条款等操作,如果需要,就会弹出登录界面供用户完成相关操作,而将这个参数设置为 0 即可禁用这种行为。
settings put global captive_portal_mode 0
修改captive_portal_https_url设置
# 1.删除设备中的captive_portal_https_url设置
## 删除这个设置意味着设备将不再尝试使用 HTTPS 方式检测 captive portal。
settings delete global captive_portal_https_url
## 删除http_url
settings delete global captive_portal_http_url
# 2.修改设备中的captive_portal_http_url为新地址
settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
## 修改设备中的captive_portal_https_url为新地址
settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204