I\'m setting up some tests and it will require a decent number of phones to be usb tethered and configured. I\'ve been successful in configuring them the way I want to once
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