是否有可能USB系绳通过终端使用ADB Android设备? [英] Is it possible to USB tether an android device using adb through the terminal?
问题描述
我设置了一些测试,它需要手机一个体面的数量是USB束缚和配置。我已经成功地配置它们的方式,我想一旦被束缚,但是这将是非常乏味的通过导航菜单,每一次我(重新)启动我的电脑或移动测试的银行系绳手机。我目前正在使用运行的CyanogenMod v10.1.0的Nexus S手机,但是测试的银行可能会是三星Galaxy S4的与少数的Nexus S手机我手头上有可能是混合的。
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.
我想这样做,作为一个bash脚本,但我想获得它在命令行中工作(Ubuntu的13.04)首,以去除可能来自脚本问题。我应该能够处理使之成为一个脚本自己,但如果是简单的提供一个答案bash脚本,请做。我试图炮击到设备( ADB -s $设备ID壳
)并运行:
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
) and running:
setprop sys.usb.config rndis,adb
这立即踢我出设备外壳和设备不再访问。如果我运行一个 ADB设备
我看到手机的??????????没有权限在这一点上我也要把USB连接线出来,然后重新插上,并且还重新启动了亚行服务器 ADB杀死服务器
亚行启动服务器
。这是行不通的,因为我不能使用手机,使我需要的配置更改。
This promptly kicks me out of the device shell and the device is no longer accessible. If I run an adb devices
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 adb kill-server
adb start-server
. This will not work because I cannot access the phone to make the configuration changes that I need.
我GOOGLE了四周,但一直无法找到任何成果。有什么建议?
I've googled around but have been unable to find anything fruitful. Any suggestions?
推荐答案
必须具有root改变与 setprop
价值观,我在Mac OS没有RNDIS驱动程序所以我不能测试你的USB网络的方法。另一种方法,如果你的连接服务(亚行外壳的服务列表
):
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
):
亚行外壳苏-c服务呼叫连接34 I32 1
打开USB绑定。
亚行外壳苏-c服务呼叫连接34 I32 0
关闭USB绑定。
在调用公众诠释setUsbTethering(布尔启用)
android.net.IConnectivityManager
。
这篇关于是否有可能USB系绳通过终端使用ADB Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!