无法通过 ADB 通过 wifi 连接到 Android - 我需要 root 访问权限吗?

发布于 2024-11-15 02:14:14 字数 575 浏览 9 评论 0 原文

我基本上正在尝试这样做: 如何通过 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手机。

谢谢!

I'm basically trying to do this:
How can I connect to Android with ADB over TCP?
with the Droid X2.

I have USB Debugging on, and my phone is plugged in via USB.
The IP Address is 10.0.78.33 (I have verified that I can do TCP communication to the phone on that IP, and I can ping it).

I go to the command line and do the following:

>>adb tcpip 5555

restarting in TCP mode port: 5555

>>adb connect 10.0.78.33:5555

unable to connect to 10.0.78.33:5555

Any thoughts on why this doesn't work? Do I need root access in order to do this? I'm trying to avoid rooting the phone.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

放我走吧 2024-11-22 02:14: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.

夜夜流光相皎洁 2024-11-22 02:14:14

症状

在我的手机上,这个问题经常发生。我遇到以下症状:

  • ping xxxx 超时
  • adb connect xxxx 超时(“无法连接”)
  • telnet xxxx 5555 超时

解决方法

我需要的 在计算机上运行 adb connect 之前禁用并重新启用手机上的 WiFi。然后我可以 pingtelnetadb 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 out
  • adb connect x.x.x.x times out ("unable to connect")
  • telnet x.x.x.x 5555 times out

Workaround

I need to disable and re-enable WiFi on my phone before running adb connect on my computer. Then I can both ping, telnet, and adb connect to the phone.

I'm using a Sony Xperia M C1904 running CyanogenMod 12.1.

静谧 2024-11-22 02:14:14

就我而言,我需要将设备与代码配对。

  1. 在电话“对于开发人员”-> “Wifi调试”-> “使用代码连接”
  2. adbpair xxxx:xxxxx 密码
  3. adb connect xxxx:xxxxx

In my case i need pair device with code.

  1. in phone "For developers" -> "Wifi debug" -> "Connect with code"
  2. adb pair x.x.x.x:xxxxx password
  3. adb connect x.x.x.x:xxxxx
人海汹涌 2024-11-22 02:14:14

您的设备无需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:

enter image description here

落在眉间の轻吻 2024-11-22 02:14:14

需要 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

阳光①夏 2024-11-22 02:14:14

我遇到了同样的问题,并且我的设备已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

我纯我任性 2024-11-22 02:14:14

我的 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 using pkill adb, navigated to my platform tools folder and ran adb tcpip 5037 and then connected to my device using the 5037 port number. Boom! Worked like a charm.

淡写薰衣草的香 2024-11-22 02:14:14

在我的 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.

你的呼吸 2024-11-22 02:14:14

我知道这是一个旧线程,OP 在非常常见的情况下询问,但我想提一下我身上发生的事情。

我能够通过以下步骤通过 wifi 连接到 ADB:

  • 连接 Android 手机到计算机通过 USB(关键的初始步骤)
  • 在 android studio 中打开终端导航到 adb 安装位置,
  • 执行命令 adb tcpip 5555。这将以 TCP 模式重新启动 adb 端口:5555
  • 执行命令 adb connect
  • 第一次,您可能需要在
  • 连接建立后询问时从手机授予对 adb 的访问权限,您可以断开连接USB 电缆即可开始使用。

当我使用家里的 wifi 时,这一直有效。

Twist:

当我尝试从星巴克咖啡厅 wifi(或任何其他公共 Wi-Fi)连接时,收到错误消息无法连接到“172.16.224.20:5555”:连接被拒绝无线上网)。

经过一番研究后我意识到

许多公共 wifi 都有一些配置限制,但实际上并没有
允许通过 wifi 进行 adb

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:

  • connect android phone to computer via USB (critical initial step)
  • open terminal in android studio & navigate to where the adb is installed
  • execute command adb tcpip 5555. this will restart the adb in TCP mode port: 5555
  • execute command adb connect <ip address>
  • for first time you might need to give access to adb from phone when asked
  • after connection establishes, you can disconnect the usb cable and you're good to go.

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

many public wifi has some configuration restrictions which doesn't
allow adb over wifi

.

抚你发端 2024-11-22 02:14:14

我无法通过 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.

情绪失控 2024-11-22 02:14:14

运行 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 restart adb you won't see the device if you run adb devices on the host.

Instead, you have to run adb connect 10.0.78.33:5555

风为裳 2024-11-22 02:14:14

我希望这对我有用并且对我有用

  1. 从工作室断开手机。
  2. 转到手机中的开发者选项。
  3. 在USB调试下,有一个选项可以撤销USB调试授权。
  4. 然后单击“确定”。
  5. 然后再次通过 USB 将手机连接到工作室。
  6. 然后单击 ADB Wifi 中的连接按钮。
  7. 现在您无需 USB 即可运行和调试应用程序

I hope this will helpful and worked for me

  1. Disconnect phone from studio.
  2. Go to developer options in phone.
  3. Under USB debugging, there is an option to Revoke USB debugging authorisations.
  4. Then click ok.
  5. Then again connect phone to studio via USB.
  6. Then click on connect button in ADB Wifi.
  7. Now you can run and debug apps without USB
秋日私语 2024-11-22 02:14:14

使用更高的端口重新启动 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

紫瑟鸿黎 2024-11-22 02:14:14

使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文