简体   繁体   English

亚行通过无线

[英]ADB over wireless

Hey i was wondering do you need root to do this any more? 嘿,我想知道你需要root才能做到这一点吗? I want to install/run apps over wireless to stop all this cable switching. 我想通过无线安装/运行应用程序来停止所有这些电缆切换。 I have also read that it can cause some errors though? 我还读过它会导致一些错误吗? That was on old posts on this site, I was wondering is it reliable and easy to do now? 这是在这个网站上的旧帖子,我想知道它现在可靠和容易吗?

Rooting is not required. 生根不是必需的。 With USB cable connected, port 5555 opened across all involved firewalls and debug mode enabled 连接USB电缆后,端口5555在所有相关防火墙上打开,并启用调试模式

adb tcpip 5555

then look into wireless properties of your device and the network you use, to see which IP address have been granted to device (or configure your DHCP always to use the same for the device mac address). 然后查看您的设备和您使用的网络的无线属性,以查看已授予设备的IP地址(或配置您的DHCP始终使用相同的设备MAC地址)。 Then 然后

adb connect 192.168.1.133

(were 192.168.1.133 is a sample IP address). (192.168.1.133是一个示例IP地址)。

This is all. 这是所有的了。 You can now use adb shell or adb install or adb upload or the like with USB cable plugged out. 现在,您可以使用插入USB电缆的adb shelladb installadb upload

To switch back to USB mode, 要切换回USB模式,

adb usb

The device may also revert back to USB mode after reboot. 重启后,设备也可能恢复为USB模式。

This mode is needed for development of applications that use attached USB devices directly (USB port is used by device so cannot be used by ADB). 开发直接使用连接的USB设备的应用程序需要此模式(USB端口由设备使用,因此ADB不能使用)。 It is briefly covered in the USB debugging section of the Android website. 它简要介绍了Android网站的USB调试部分

I ran into the same problem today and find that things are fine on my non-rooted 4.2 Galaxy Nexus device, but does not work on my older (again non-rooted) Samsung Galaxy Y (2.3) device. 我今天遇到了同样的问题,发现在我的非root 4.2 Galaxy Nexus设备上的情况很好,但是对我的旧版(同样没有根)的三星Galaxy Y(2.3)设备不起作用。

I tried the steps given here but looks like one needs a rooted phone to work on some of the earlier models (and maybe other non-nexus devices too). 我尝试了这里给出的步骤但看起来需要一个带根电话来处理一些早期的模型(也可能是其他非nexus设备)。

This is what I tried - 这是我试过的 -

$ adb shell netstat | grep 5555

No socket was opened on this port. 此端口上未打开任何套接字。

Tried to manually set the steps that adb tcpip does - 试图手动设置adb tcpip的步骤 -

$ adb shell setprop service.adb.tcp.port 5555
$ adb shell stop adbd
$ adb shell start adbd
$ adb shell getprop | grep adb

This does not show the property that was just set. 这不显示刚刚设置的属性。

This is what it shows on my nexus device where it works without rooting - 这是它在我的nexus设备上显示的,它在没有生根的情况下工作 -

$ adb shell getprop | grep adb
[service.adb.tcp.port]: [5555]

So depending on what phone/OS version u have, your mileage might vary. 因此,根据您的手机/操作系统版本,您的里程可能会有所不同。

:-) :-)

For wireless adb on my Nexus 4 @ Android 4.4.2 (Kitkat) I usually do: 对于我的Nexus 4 @Android 4.4.2(Kitkat)上的无线adb,我通常会这样做:

  1. Turn on usb debug in 'Developer options' 在'开发者选项'中启用USB调试
  2. Connect via usb cable, accept an RSA key dialog 通过USB电缆连接,接受RSA密钥对话框
  3. adb tcpip 5555
  4. adb connect 192.168.?.? (device IP on local wlan) (本地wlan上的设备IP)
  5. Disconnect usb cable 断开USB电缆

  6. Test if connection is still on: adb devices 测试连接是否仍然存在: adb devices

No root required 不需要root

For wireless ADB without USB cable is possible but you need to use one time setup connection with PC using usb cable. 对于无USB ADB的无线ADB,您需要使用usb电缆与PC进行一次性设置连接。 make sure USB debugging mode should be on. 确保USB调试模式应该打开。 Connect device on same wifi. 在同一个wifi上连接设备。 then run 然后运行

  • adb tcpip 5555 adb tcpip 5555
  • adb connect yourdeviceIP adb连接你的设备

To find current device IP and to setup adb wireless use app (without rooting device) 查找当前设备IP并设置adb无线使用应用程序(无需root设备)

https://play.google.com/store/apps/details?id=com.freeappmakr.adb https://play.google.com/store/apps/details?id=com.freeappmakr.adb

Using this app you can setup your device with wireless adb. 使用此应用程序,您可以使用无线adb设置设备。

If any error in setup use 如果设置中的任何错误使用

adb kill-server adb kill-server

then try again 然后再试一次

If you installed adbd Insecure on your device, it will prevent you from connecting to your device via WiFi. 如果您在设备上安装了adbd Insecure,则会阻止您通过WiFi连接到您的设备。 You have to uncheck the "Enable insecure adbd" in the app adbd Insecure. 您必须取消选中应用adbd Insecure中的“启用不安全adbd”。

See FIXED: Can't connect to adb over wifi 请参阅修复:无法通过wifi连接到adb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM