Android adb 控制网络状态

>adb shell svc
Available commands:
help Show information about the subcommands
power Control the power manager
data Control mobile data connectivity
wifi Control the Wi-Fi manager

>adb shell svc power
Control the power manager

usage: svc power stayon [true|false|usb|ac]
Set the 'keep awake while plugged in' setting.


>adb shell svc data
Control mobile data connectivity

usage: svc data [enable|disable]
Turn mobile data on or off.

svc data prefer
Set mobile as the preferred data network


>adb shell svc wifi
Control the Wi-Fi manager

usage: svc wifi [enable|disable]
Turn Wi-Fi on or off.

svc wifi prefer
Set Wi-Fi as the preferred data network

转载于:https://www.cnblogs.com/HQMIS/archive/2013/01/28/2880605.html

你可能感兴趣的:(移动开发,shell)