Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an ADB command to enable/disable mobile data?(Rooted Device)

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?

like image 757
Patrick Avatar asked May 07 '14 21:05

Patrick


People also ask

How do I enable ADB commands?

Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try . ADB devices to see if it's working. A list with attached devices should show up.

What can you do with ADB root?

ADB, Android Debug Bridge, is a command-line utility included with Google's Android SDK. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.


1 Answers

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
like image 83
Patrick Avatar answered Sep 21 '22 13:09

Patrick