当前位置: 首页 > news >正文

adb控制设备状态

屏幕设置

屏幕亮度

# 当前屏幕亮度
adb shell settings get system screen_brightness# 更改屏幕亮度adb shell settings put system screen_brightness

屏幕休眠时间

# 当前屏幕休眠时间
adb shell settings get system screen_off_timeout#更改屏幕休眠时间
adb shell settings put system screen_off_timeout 10000

蓝牙

获取蓝牙状态

# 1是开,0是关
adb shell settings get global bluetooth_on# enabled:true是开,enabled: false是关
adb shell dumpsys bluetooth_manager | findstr enabled

设置蓝牙状态

# 开启蓝牙
adb shell settings put global bluetooth_on 1
# 关闭蓝牙
adb shell settings put global bluetooth_on 0# 这个方法重启才会生效
adb shell svc bluetooth enable
adb shell svc bluetooth disable# 出现弹窗,点击允许后开启蓝牙
adb shell am start -a android.bluetooth.adapter.action.REQUEST_ENABLE# 进入蓝牙界面,根据实际再点击页面
adb shell am start -a android.settings.BLUETOOTH_SETTINGS# 调用appium的广播,会出现弹窗需点击
adb shell am broadcast -a io.appium.settings.bluetooth --es setstatus enable

WiFi和热点

获取网络状态

# windows系统用findstr,linux系统用grep
adb shell ps | findstr wifi
# 有wpa_supplicant就表示wifi开启,有hostapd就表示热点开启
wifi            626      1   13992   3280 0                   0 S android.hardware.wifi@1.0-service
wifi           1016      1   15264   2944 0                   0 S wificond
wifi           4961      1   23880   7944 0                   0 S wpa_supplicant
wifi           5027      1   13384   4936 0                   0 S hostapd

设置WiFi状态

# 打开WiFi
adb shell svc wifi enable  #关闭WiFi
adb shell svc wifi disable  

设置热点状态

# 进入热点界面,根据实际再点击页面
adb shell am start -n com.android.settings/.TetherSettings
http://www.lryc.cn/news/291120.html

相关文章:

  • 订婚支出及共同生活消费是否属于彩礼?应否返还?
  • MicroPython核心:优化
  • Opencv——霍夫变换
  • Github 2024-01-28 开源项目日报Top10
  • 【大数据安全】大数据安全的挑战与对策基础设施安全
  • 【LLM多模态】Cogview3、DALL-E3、CogVLM、CogVideo模型
  • python爬虫学习之selenium_chrome handless的使用
  • Spring boot + Azure OpenAI 服务 1.使用 GPT-35-Turbo
  • Vite+Vue3使用Vue-i18n笔记
  • 流量密码《幻兽帕鲁》5天狂销700万份
  • 怎么查询鸿蒙真机支持的API版本
  • 【NodeJS】005- NodeJS的NVM与express框架
  • pandas使用read_csv时报错解决
  • Optimism的挑战期
  • Linux——安装MySQL
  • java常量和kotlin常量
  • Python学习笔记--创建最简单的自定义异常类
  • 2024年,AI 掀起数据与分析市场的新风暴
  • 小程序软件测试应该怎么做?有什么作用?
  • springboot2.2.9整合kafka之KafkaListener实现原理
  • 数据结构day7
  • cleanmymacX有必要买吗
  • 智慧文旅:打造无缝旅游体验的关键
  • C语言 | 求最大/小值小技巧:fmax、fmin函数
  • 【深度学习每日小知识】Model Accuracy 模型准确率
  • 智能AI系统开发,专业软件硬件物联网开发公司,探索未来科技新纪元
  • 第七篇:node中间件详解
  • Jenkins自动化打包
  • 【服务端性能测试】性能测试策略如何做
  • 透明拼接屏造型:多样拼接与影响因素