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 they have been tethered, however it would be quite tedious to tether the phones through navigating the menus, each and every time I (re)start my computer or move the test bank. I am currently using Nexus S phones running cyanogenmod v10.1.0, however the test bank will likely be Samsung Galaxy S4's possibly mixed with the few Nexus S phones I have on hand.
I want to do this as a bash script, but I'm trying to get it work at the command line (Ubuntu 13.04) first so as to remove issues that could come from scripting. I should be able to handle making it into a script myself, but if it's simple to provide an answer as bash script, please do. I tried shelling into the device (
adb -s $deviceID shell
setprop sys.usb.config rndis,adb
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):
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.
public int setUsbTethering(boolean enable) in