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

前端 未结 7 1951
终归单人心
终归单人心 2020-12-29 10:30

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

7条回答
  •  再見小時候
    2020-12-29 10:43

    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

提交回复
热议问题