1

How do I turn off USB tethering or restart USB connection via computer/PC's terminal?

2
  • Do you want to accomplish this from Android's terminal or from computer's (to which android phone is connected) terminal?
    – user55027
    Commented Mar 23, 2014 at 11:12
  • @edvinas.me preferably from computer if possible
    – user42276
    Commented Mar 23, 2014 at 11:22

2 Answers 2

1

Fastest, foolproof way is just unplug it, that terminates the connection and the service. Otherwise the answer above is useful, or you could just issue adb reboot (assuming you have USB debugging on). Otherwise you'd need to find the PID in your PC operating system and stop that service.

0

Léo Lam in his answer explained the relevant commands that can be used using adb shell.

Running the following command as root should enable USB tethering:

service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0)
service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3)
service call connectivity 34 i32 1 on KitKat (4.4)
service call connectivity 30 i32 1 on Lollipop (5.0)

See further information in his answer.

Setup ADB in PC, enable USB debugging, launch Terminal/CMD in PC and enter:

adb shell su -c "<cmd>"

Replace "<cmd>" with the relevant aforesaid command to enable USB tethering. Change 1 to 0 to disable USB tethering.

E.g. For My Jelly Bean 4.2.1, the commands would be:

  • Enable USB tethering

    adb shell su -c "service call connectivity 33 i32 1"
    
  • Disable USB tethering

    adb shell su -c "service call connectivity 33 i32 0"
    

Not the answer you're looking for? Browse other questions tagged .