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

前端 未结 7 1908
终归单人心
终归单人心 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 11:03

    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: 34
    5.1.0: 30
    6.0.1: 30
    7.0.0: 33
    
    0 讨论(0)
提交回复
热议问题