简体   繁体   English

Android Studio BumbleBee 对 wifi 不工作

[英]Android Studio BumbleBee pair wifi not working

I am trying to connect my Android 11 device with the android studio over adb wifi but it is not working.我正在尝试通过 adb wifi 将我的 Android 11 设备与 android studio 连接,但它无法正常工作。

I updated to the latest stable bumblebee and updated my SDK I tried turning off the firewall on my pc but it is the same result.我更新到最新的稳定大黄蜂并更新了我的 SDK 我尝试关闭我电脑上的防火墙,但结果相同。

When I use the QR code method my android phone just shows "pairing device" and nothing happens If I try the code method, the android studio just shows "searching for devices" but nothing happens当我使用二维码方法时,我的 android 手机只显示“正在配对设备”,但没有任何反应如果我尝试二维码方法,android 工作室只显示“正在搜索设备”,但没有任何反应

and, yes, I enabled wireless debugging on my phone and I am connected to the same wifi.network.而且,是的,我在手机上启用了无线调试,并且连接到同一个 wifi.network。

I don't know if the problem is with my computer or phone.不知道是电脑问题还是手机问题。 I do not have any other Android11+ phone to try with我没有其他 Android11+ 手机可以试用

Go to Settings -> Build, Execution... -> Debugger -> Built-in Server Go 到Settings -> Build, Execution... -> Debugger -> Built-in Server

and in the Built-in Server option set the value of Port as the same port you see in your phone and tick the Can accept external connections并在Built-in Server选项中将Port的值设置为您在手机中看到的相同端口并勾选可以接受外部连接

after that go to wireless pairing and your device will show now之后 go 进行无线配对,您的设备将立即显示

I was having the same problem as you.我遇到了和你一样的问题。 Neither pairing by QR nor by pairing code worked.通过 QR 配对或配对码配对均无效。

So I tried connecting by typing adb connect [phone_ip]:[port] in the terminal and that worked flawlessly.因此,我尝试通过在终端中键入adb connect [phone_ip]:[port]进行连接,并且运行良好。 Didn't even need to plug the phone into the computer with a USB.甚至不需要用 USB 将手机插入电脑。 Your phone will tell you the IP and port right above the "pair with QR code" option inside the Wi-Fi debugging setting.您的手机会告诉您 IP 和 Wi-Fi 调试设置中“与二维码配对”选项正上方的端口。 Just connect to that address.只需连接到该地址。

I had this issue;我有这个问题; it paired fine the first time in-app but never worked again when trying to pair or connect directly from Android Studio.它第一次在应用程序内配对很好,但在尝试直接从 Android Studio 配对或连接时再也没有工作过。

What I now do to connect/pair is the following:我现在连接/配对的操作如下:

  • Open your phone's settings and be sure to enable wireless debugging in developer options打开手机设置,一定要在开发者选项里开启无线调试
  • Click Pair device with pairing code , and keep it on that screen.单击Pair device with pairing code ,并将其保留在该屏幕上。
  • Now, go into a terminal and cd into the %LOCALAPPDATA%\Android\sdk\platform-tools directory.现在,go 进入终端并cd进入%LOCALAPPDATA%\Android\sdk\platform-tools目录。
  • After that, type adb pair <PHONE_IP>:<PHONE_PORT>之后,输入adb pair <PHONE_IP>:<PHONE_PORT>
  • Input the pairing code when prompted提示时输入配对码
  • Finally, run adb connect <PHONE_IP>:<PHONE_PORT_PROVIDED_ABOVE_PAIR_WITH_QR_BUTTON> , and it should connect;最后,运行adb connect <PHONE_IP>:<PHONE_PORT_PROVIDED_ABOVE_PAIR_WITH_QR_BUTTON> ,它应该连接; Android Studio will automatically detect the connection, so that's it! Android Studio 会自动检测连接,就这样!

Enable wifi debug on your phone.在手机上启用 wifi 调试。

Then write in terminal of android studio:然后在android工作室的terminal中写入:

adb pair [192.xxx.xxx.xxx]:[xxxxx] the data you get from pair with code tab

Press enter.按回车。

Then type your pair password.然后输入您的配对密码。

Then然后

adb connect [192.xxx.xxx.xxx]:[xxxxx] your data from pair via wifi

If not working again just restart phone and try again如果不能再次工作,请重新启动手机并重试

In my case, I have a galaxy s10e, and I need to put my phone in charge and activate wifi debugging and when it's connected with android studio, I can unplug the phone and it still works .就我而言,我有一个galaxy s10e,我需要把我的手机充电并激活wifi调试,当它与android studio连接时,我可以拔掉手机,它仍然可以工作 In Huawei there is an option in developer options "Allow ADB debugging in load only mode", we can disable it and it works without charging the phone.在华为的开发者选项中有一个选项“允许在仅加载模式下进行ADB调试”,我们可以禁用它,它可以在不给手机充电的情况下工作。 On s10e there is no such option, I think that it is allowed by default and we can't change it.在s10e上是没有这个选项的,我觉得默认是允许的,我们也改不了。

It may be worth your while to ensure:确保:

  1. The relevant API is installed in Android Studio (either 30 or 31/"S" since this is a feature only available on phones running Android 11 and up).相关的 API 安装在 Android Studio 中(30 或 31/“S”,因为该功能仅适用于运行 Android 11 及更高版本的手机)。
  2. adb.exe is not blocked by your system's firewall (on Windows, check this in Windows Security > Firewall and network protection > allow an app through firewall). adb.exe 未被系统防火墙阻止(在 Windows 上,在 Windows 安全 > 防火墙和网络保护 > 允许应用程序通过防火墙中进行检查)。
  3. The latest build-tools are installed, as mentioned in the comments.如评论中所述,已安装最新的构建工具。

After that, the connection wizard at least recognized my device (Samsung Note 10), but failed to connect and gave a generic error message.之后,连接向导至少识别出我的设备(Samsung Note 10),但无法连接并给出一般错误消息。 I avoided this by using adb pair <ip-address>:<port> <code> as mentioned in this answer.答案所述,我通过使用adb pair <ip-address>:<port> <code>避免了这种情况。 Seems like this feature still has a ways to go.似乎这个功能仍然有办法 go。

I was having the same problem.我遇到了同样的问题。 QR Code, Pairing code, or even connecting manually with the "adb connect [phone_ip]:[port]" method didn't work.二维码、配对码,甚至使用“adb connect [phone_ip]:[port]”方法手动连接都不起作用。 However, the problem was solved as soon as I disabled the " AP isolation " option on the modem settings .但是,一旦我禁用调制解调器设置上的“ AP 隔离”选项,问题就解决了。

Restart you device and wait 30 min and do it again重新启动您的设备并等待 30 分钟,然后再做一次

wireless debugging android studio |无线调试android工作室| Run/install/debug Android applications over Wi-Fi?.通过 Wi-Fi 运行/安装/调试 Android 应用程序? Wireless ADB debugging is made much simpler by Android Studio Bumblebee Android Studio Bumblebee 让无线 ADB 调试变得更加简单

在此处输入图像描述

Prerequisites: It is essential to make sure that you are running the most recent version of Android Studio which is Android Studio Bumblebee 2021.1.1 or later.先决条件:必须确保您运行的是最新版本的 Android Studio,即 Android Studio Bumblebee 2021.1.1 或更高版本。 A physical device that runs Android 11 or later Options for Developers must be turned on in the device's physical settings.运行 Android 11 或更高版本的物理设备 开发人员选项必须在设备的物理设置中打开。 Connect via the identical WiFi system as you are connected to with your Android Studio.通过与 Android Studio 连接的相同 WiFi 系统进行连接。 Take note of this WiFi connection must be extremely stable.请注意,此 WiFi 连接必须非常稳定。

You can Follow these Steps for Connection Successfully wireless debugging android您可以按照以下步骤连接成功无线调试android

  1. Turn off and turn on Wi-Fi on your phone.关闭并打开手机上的 Wi-Fi。
  2. Ping the phone firstly: ping 192.168.1.97 .ping电话: ping 192.168.1.97 You should see that packets are transmitted.您应该看到数据包已传输。
  3. Now you highly likely can connect to the phone using QR-code or adb pair现在您很可能可以使用 QR 码或adb pair连接到手机

I periodically get this problem (Pairing Android Studio on my Mac to Android Phone, the Computer just hangs after phone scans QR code).我定期遇到此问题(将我的 Mac 上的 Android 手机配对 Android Studio,手机扫描二维码后计算机就挂起)。 When I disable and then re-enable wifi debugging on the Android phone, it connects on the next attempt.当我在 Android 手机上禁用然后重新启用 wifi 调试时,它会在下一次尝试时连接。

I tried everything to fix this and nothing worked.我尝试了一切来解决这个问题,但没有任何效果。 In frustration, I went for a walk.无奈之下,我去散步了。 When I came back - it worked.当我回来时 - 它奏效了。

So while I can't say for sure what fixed it, try turning your phone's WiFi off then on again.因此,虽然我不能确定是什么修复了它,但请尝试关闭手机的 WiFi,然后再打开。

Try to update SDK Platform-Tool and Build-tools.尝试更新 SDK 平台工具和构建工具。

I was able to get it to pair, by toggling my (Windows 11) computer's WiFi off/on, and then clicking "Pair using Wi-Fi" again.通过关闭/打开我的(Windows 11)计算机的 WiFi,然后再次单击“使用 Wi-Fi 配对”,我能够让它配对。

My problem was with the file "devices.xml" located in $USER_FOLDER/.android I have renamed it and the problem goes.我的问题是位于 $USER_FOLDER/.android 中的文件“devices.xml”,我已重命名它,问题就出现了。

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

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