https://stackoverflow.com/questions/20226924/is-it-possible-to-usb-tether-an-android-device-using-adb-through-the-terminal
http://android.stackexchange.com/questions/29954/can-i-change-some-android-settings-from-the-command-line
method 1
adb shell
am start -n com.android.settings/.TetherSettings
adb shell input tap <x> <y> method 2
setprop sys.usb.config rndis,adb
method 3Running 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 and Jelly Bean 4.2service call connectivity 34 i32 1
on Jelly Bean 4.3 and KitKat (4.4)service call connectivity 30 i32 1
on Lollipop (5.0)
The first number you see in the commands is the setUsbTethering()
method's number in IConnectivityManager.aidl
(this depends on the Android version and doesn't exist on Gingerbread).
(Tip: to check this file for a particular Android version, select the appropriate branch.)
So what this command does is call setUsbTethering()
and pass either 1 (enable USB tethering) or 0 (to disable it).
For more information, see this related question on Stack Overflow.
But, all of these method failed, because of "permission denied"