adb 禁止app联网_是否有一个ADB命令启用/禁用移动数据?(root权限的设备)

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-22 19:15   125   0

I'm looking for an adb shell command to enable/disable mobile data. The app is only being tested on rooted devices so I have adb root privileges. I looked around and found that wifi can be enabled/disabled with:

$ adb shell svc wifi enable

$ adb shell svc wifi disable

These work for me but I wasn't able to find anything for mobile data.

Any reference to a list of adb shell svc commands that can be performed would be appreciated as well. I know there's a list of key input commands from this question and obviously I'm aware of the developer page but there's no mention of svc.

Lastly, what is svc?

解决方案

I found the answer to my question:

To enable mobile data:

$ adb shell svc data enable

To disable mobile data:

$ adb shell svc data disable

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP