title: Is it possible to USB tether an android device using adb through the terminal?
body: <p>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.</p>
  
  <p>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 (<code>adb -s $deviceID shell</code>) and running:</p>
  
  <pre><code>setprop sys.usb.config rndis,adb
  </code></pre>
  
  <p>This promptly kicks me out of the device shell and the device is no longer accessible.  If I run an <code>adb devices</code> I see the phone as "?????????? No Permissions" at which point I have to take the USB cable out and then plug it in again, and also restart the adb server with <code>adb kill-server</code> <code>adb start-server</code>.  This will not work because I cannot access the phone to make the configuration changes that I need.</p>
  
  <p>I've googled around but have been unable to find anything fruitful. Any suggestions?</p>