How to turn off Wifi via ADB
2016-07-13 09:54
579 查看
Using "svc" through ADB:
Enable:adb shell svc wifi enable
Disable:
adb shell svc wifi disable
Using Key Events through ADB:
You can use "keyevents":adb shell am start -a android.intent.action.MAIN -n com.android.settings/.wifi.WifiSettings adb shell input keyevent 20 & adb shell input keyevent 23
Using "adb shell", you can intent the android settings package and run the "wifi.WifiSettings" activity. From here we must then implement the key presses.
I tested those two lines on a Droid X.
Also, if you need to know more about "keyevents":
ADB Shell Input Events
to use those keyevents to toggle wifi in Android 5.0 you would probably have to hit different events then in answer. I would say adb shell input keyevent 19 & adb shell input keyevent 19 & adb shell input keyevent 23(the first one can be 20 as well) - this is working if there is no option selected when you enter the wifi settings screen (if there is, you should skip the first event) |
相关文章推荐
- Python实现的基于ADB的Android远程工具
- 深入android中The connection to adb is down的问题以及解决方法
- Window下adb shell中文乱码问题解决方法
- 一些比较实用的 Android adb 命令分享
- android开发教程之ubuntu使用adb连接小米2的步骤和adb调试方法
- Android 用adb pull或push 拷贝手机文件到到电脑上,拷贝手机数据库到电脑上,拷贝电脑数据库到手机上
- Android adb 出错解决方法
- 导致adb无法启动的5种情况和解决方法
- Ubuntu下android adb环境变量配置方法
- adb 启动报错
- android 命令
- 使用bat文件快速解决adb找不到设备的问题
- 使用PC的adb工具通过wifi(TCP方式)调试安卓设备
- Android的ps命令介绍和技巧
- adb基本命令
- Android Shell命令之dumpsys部分功能简介
- adb shell dumpsys 命令
- android关于adb的一点小知识
- Android开发常用命令整理
- Android开发常用命令整理