如何通过ADB关闭WiFi? [英] How to turn off Wifi via ADB?

查看:2402
本文介绍了如何通过ADB关闭WiFi?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林自动化的无线通话功能的测试程序,我不知道有没有办法通过ADB开启/关闭无线?

Im automating a testing procedure for wifi calling and I was wondering is there a way to turn off/on wifi via adb?

我要么要禁用/启用WiFi或杀死的wifi致电(com.movi​​al.wificall),并重新启动它。

I would either like to disable/enable wifi or kill wifi calling (com.movial.wificall) and restart it.

是否有可能通过亚行和shell命令都做到这一点?

Is it possible to do this all via adb and shell commands?

到目前为止,我还发现:

so far I have found:

android.net.wifi.WifiManager
setWifiEnabled(true/false)

我只是不知道如何把它一起

Im just not sure how to put it together

推荐答案

启用:

adb shell svc wifi enable

停用

adb shell svc wifi disable

到亚行采用关键事件:

您可以使用的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

使用亚行壳,即可意图Android设置包,并运行wifi.WifiSettings活动。从这里我们必须再实施重点presses。

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.

我测试了这两条线在Droid X的。

I tested those two lines on a Droid X.

另外,如果你需要更多地了解的KeyEvents:

ADB命令行输入活动

这篇关于如何通过ADB关闭WiFi?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆