2

SVC命令, WIFI开关、GPRS数据开关

 1 year ago
source link: http://abcdxyzk.github.io/blog/2022/09/17/svc/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

SVC命令, WIFI开关、GPRS数据开关

2022-09-17 17:13:00

https://blog.csdn.net/weixin_32388647/article/details/117491092

svc命令,位置在/system/bin目录下,用来管理电源控制,无线数据,WIFI。

Available commands:

help Show information about the subcommands

power Control the power manager

data Control mobile data connectivity

wifi Control the Wi-Fi manager

svc power

svc power

Control the power manager

usage: svc power stayon [true|false|usb|ac]

Set the ‘keep awake while plugged in'setting.

//设置屏幕的常亮,true保持常亮,false不保持,usb当插入usb时常亮,ac当插入电源时常亮

svc data

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

//设置移动网络的数据优先于WIFI

svc wifi

svc wifi

Control the Wi-Fi manager

usage: svc wifi [enable|disable]

Turn Wi-Fi on or off.//设置WIFI是否启用

svc wifi prefer

Set Wi-Fi as the preferred data network//设置WIFI优先于移动网络的数据,一般应设置成这样,除非你刻意使用移动网络数据传输

命令详细介绍:

svc命令 这个脚本在/system/bin目录下,这个命令可以用来控制电源管理,wifi开关,数据开关(就是上网流量)

svc power stayon [true|false|usb|ac]

这个是控制usb插入的时候屏幕是否常亮,这个有地方设置,就不多说了

svc data disable 这个命令可以关闭数据连接,就是上网流量,大家都知道控制上网的开关很多,但是大都是通过在apn上的接入点加后缀来实现的,但是这个命令不会更改apn的任何设置,直接在底层关闭数据连接。 应该是最彻底的,而且又不影响apn的设置。这个跟apndroid有什么区别,apndroid是在关闭上网数据的时候,已经在下载的连接可能不会被强制关闭(这个在apndroid自己的说明中也有提到)。比如你在下载一个10M的电影,下载了1M,不响下载了。用apndroid关闭连接,可能这个下载还会继续,不会马上停掉。但是用这个命令,绝对毫不留情的咔嚓掉。

svc data enable

这个是打开上网数据连接,跟上一个命令是相反的。

svc data prefer

这个命令是控制3g数据连接比wifi优先。我们都知道,正常情况下,有wifi的时候,不会用到3g连接。但是这个命令是相反,有3g的话先用3g流量,没有3g的时候采用wifi.我想大家不会这么傻吧,所以这个命令没什么用。

svc wifi disable

关闭wifi 连接

svc wifi enable

开启wifi连接

svc wifi prefer 设置wifi优先,跟5是相反的。

com.android.commands.svc.DataCommand

Posted by kk

2022-09-17 17:13:00android, base

« 海康iVMS换IP usb网卡驱动 »

wx_ok.pngali_ok.png

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK