无法通过 ADB 通过 wifi 连接到 Android - 我需要 root 访问权限吗?
我基本上正在尝试这样做: 如何通过 TCP 使用 ADB 连接到 Android?< /a> 与 Droid X2 一起。
我已打开 USB 调试,并且我的手机已通过 USB 插入。 IP 地址是 10.0.78.33(我已经验证可以在该 IP 上与电话进行 TCP 通信,并且可以 ping 通它)。
我进入命令行并执行以下操作:
<块引用>>>adb tcpip 5555
以TCP模式重启端口:5555
>>adb 连接 10.0.78.33:5555
无法连接到 10.0.78.33:5555
有什么想法为什么这不起作用?我需要 root 访问权限才能执行此操作吗?我试图避免root手机。
谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(14)
第 1 步。 在 PC/笔记本电脑上转到 Androidsdk\platform-tools
第 2 步:
通过 USB 连接您的设备并运行:
adb Kill-server
然后运行
adb tcpip 5555
您将看到以下消息...
守护进程未运行。现在在端口 5037 上启动*
守护进程成功启动 * 以 TCP 模式重新启动 端口:5555
第三步:
现在打开新的 CMD 窗口,
转到 Androidsdk\platform-tools
现在运行
adb connect xx.xx.xx.xx:5555< /strong>(xx.xx.xx.xx 是设备 IP)
第四步:断开设备与 USB 的连接,它将像从 Android studio 连接一样工作。
Step 1 . Go to Androidsdk\platform-tools on PC/Laptop
Step 2 :
Connect your device via USB and run:
adb kill-server
then run
adb tcpip 5555
you will see below message...
daemon not running. starting it now on port 5037 *
daemon started successfully * restarting in TCP mode port: 5555
Step3:
Now open new CMD window,
Go to Androidsdk\platform-tools
Now run
adb connect xx.xx.xx.xx:5555 (xx.xx.xx.xx is device IP)
Step4: Disconnect your device from USB and it will work as if connected from your Android studio.
症状
在我的手机上,这个问题经常发生。我遇到以下症状:
ping xxxx
超时adb connect xxxx
超时(“无法连接”)telnet xxxx 5555
超时解决方法
我需要的 在计算机上运行
adb connect
之前禁用并重新启用手机上的 WiFi。然后我可以ping
、telnet
和adb connect
到手机。我使用的是运行 CyanogenMod 12.1 的 Sony Xperia M C1904。
Symptoms
With my phone, this problem happens a lot. I get these symptoms:
ping x.x.x.x
times outadb connect x.x.x.x
times out ("unable to connect")telnet x.x.x.x 5555
times outWorkaround
I need to disable and re-enable WiFi on my phone before running
adb connect
on my computer. Then I can bothping
,telnet
, andadb connect
to the phone.I'm using a Sony Xperia M C1904 running CyanogenMod 12.1.
就我而言,我需要将设备与代码配对。
adbpair xxxx:xxxxx 密码
adb connect xxxx:xxxxx
In my case i need pair device with code.
adb pair x.x.x.x:xxxxx password
adb connect x.x.x.x:xxxxx
您的设备无需root。我为 IntelliJ/Android Studio 开发了一个插件,只需按一个按钮即可通过 wifi 连接您的设备。 这里是代码,这里插件可供使用。
使用方法非常简单。这里有一个 gif:
Your device hasn't to be rooted. I've developed a plugin for IntelliJ/Android Studio to connect your device over wifi pressing just one button. Here is the code and here the plugin ready to be used.
The usage is quite simple. Here you have a gif:
需要 root 才能更改该系统属性。但是,不需要通过 wifi 启动 adb。
您可以在通过 USB 连接时转发端口,然后告诉 adb 守护程序监听特定频率:
无线 ADB
Root IS needed to change that system properties. However, it is not needed to start adb over wifi.
You can forward the ports while connected through USB and then tell the adb daemon to listen over a certain frequency:
ADB over wirless
我遇到了同样的问题,并且我的设备已root。问题实际上来自 adbd Insecure。
如果您在设备上安装了 adbd Insecure,它将阻止您通过 WiFi 连接到设备。您必须在应用程序 adbd Insecure 中取消选中“启用不安全的 adbd”。
请参阅已修复:无法通过 wifi 连接到 adb
I've encoutered the same problem, and my device was rooted. The problem actually came from adbd Insecure.
If you installed adbd Insecure on your device, it will prevent you from connecting to your device via WiFi. You have to uncheck the "Enable insecure adbd" in the app adbd Insecure.
See FIXED: Can't connect to adb over wifi
我的 Samsung Tab 1 的问题是 adb 进程已经在我的 Xubuntu 14.04 计算机上的端口 5037 上运行,直到我输入
pgrep -l -u username
之前我才意识到这一点。为了解决此问题,我使用pkill adb
终止了 adb 进程,导航到我的平台工具文件夹并运行adb tcpip 5037
,然后使用5037 连接到我的设备
端口号。繁荣!工作起来就像一个魅力。The problem with me for my Samsung Tab 1 was an adb process was already running on port 5037 on my Xubuntu 14.04 machine, which I was unaware about until I typed
pgrep -l -u username
. To fix this, I terminated the adb process usingpkill adb
, navigated to my platform tools folder and ranadb tcpip 5037
and then connected to my device using the5037
port number. Boom! Worked like a charm.在我的 IDE 上工作,但在更新 Android Studio(我当前是 Android Studio 3.3)后它无法工作,并且总是提示“无法连接到设备......同一网络”。
Android wifi ADB之前 无法解决这个问题。
然后我尝试了 - WIFI ADB ULTIMATE by
https://github .com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin
它对我有用。
Android wifi ADB was earlier working on my IDE but after Updating Android Studio (my current is Android Studio 3.3) it is not working and always prompt as "Unable to connect to device......Same network"
After spending much time i was unbale to resolve the issue.
Then i tried - WIFI ADB ULTIMATE by
https://github.com/huazhouwang/WIFIADB/tree/master/WIFIADBIntelliJPlugin
It worked for me.
我知道这是一个旧线程,OP 在非常常见的情况下询问,但我想提一下我身上发生的事情。
我能够通过以下步骤通过 wifi 连接到 ADB:
adb tcpip 5555
。这将以 TCP 模式重新启动 adb 端口:5555adb connect
当我使用家里的 wifi 时,这一直有效。
Twist:
当我尝试从星巴克咖啡厅 wifi(或任何其他公共 Wi-Fi)连接时,收到错误消息
无法连接到“172.16.224.20:5555”:连接被拒绝
无线上网)。经过一番研究后我意识到
。
I know it's an old thread and OP is asking in very common scenario but I would like to mention what happened with me.
I was able to connect to ADB over wifi through below steps:
adb tcpip 5555
. this will restart the adb in TCP mode port: 5555adb connect <ip address>
This worked all the time when I'm on my home wifi.
Twist:
I got the error saying
failed to connect to '172.16.224.20:5555': Connection refused
, when i tried to connect from Starbucks cafe wifi (or any other public wifi).After some research I realized that
.
我无法通过 5Ghz WLAN 将 adb 连接到我的 Nexus5 手机,但它确实可以立即与较慢的 2.4 Ghz 配合使用。
I couldn't connect adb to my Nexus5 Phone over 5Ghz WLAN but it did work with the slower 2,4 Ghz instantly.
运行
setprop service.adb.tcp.port 5555
并重新启动adb
后,如果在设备上运行adb devices
,您将看不到该设备。主持人。相反,您必须运行
adb connect 10.0.78.33:5555
After you run
setprop service.adb.tcp.port 5555
and restartadb
you won't see the device if you runadb devices
on the host.Instead, you have to run
adb connect 10.0.78.33:5555
我希望这对我有用并且对我有用
I hope this will helpful and worked for me
使用更高的端口重新启动 adb 服务器。我试图在 5555 端口上使用 adb,但它没有连接,当我在 50370 上启动服务器时,它立即连接
Restart your adb server with higher port. I was trying to use adb on 5555 port but it didnt connect and when i started server on 50370 it connected instantly
使用 ADB-WiFi 插件,如果仍然无法连接,只需在连接之前关闭并打开设备上的 wifi。
Use ADB-WiFi plugin and if still not connecting the just switch off and switch on wifi on you device before connecting.