Is it possible to USB tether an android device using adb through the terminal? Is it possible to USB tether an android device using adb through the terminal? bash bash

Is it possible to USB tether an android device using adb through the terminal?


Must have root to change values with setprop, and I am on a Mac OS without a rndis driver so I could not test your method of USB tethering. Another way, if you have the connectivity service (adb shell service list):

The following commands call ConnectivityManager.setUsbTethering(boolean enable) in Android 4.3:

adb shell su -c service call connectivity 34 i32 1 turns on USB tethering.

adb shell su -c service call connectivity 34 i32 0 turns off USB tethering.

For other Android versions replace 34 with the following setUsbTethering calling codes per Android version:

4.4.4: 345.1.0: 306.0.1: 307.0.0: 33


Commands in accepted answer not work on Oreo because now should be additional parameter callerPkg and if put there some random text it works.

int setUsbTethering(boolean enable, String callerPkg);

So, for 8.0 / 8.1 Oreo:

service call connectivity 34 i32 1 s16 text - turn USB tethering ON

service call connectivity 34 i32 0 s16 text - turn USB tethering OFF

It works for me Android Pie with

service call connectivity 33 i32 1 s16 text - turn USB tethering ON

service call connectivity 33 i32 0 s16 text - turn USB tethering OFF


For Android 5.0+ (Lollipop, Marshmallow) use:

adb shell su -c service call connectivity 30 i32 1 to turn USB Tethering ON

adb shell su -c service call connectivity 30 i32 0 to turn USB Tethering OFF

Keep in mind that this requires root.