adb -s 192.168.1.6:5555 .....错误:多个设备/仿真器 [英] adb -s 192.168.1.6:5555 ..... error: more than one device/emulator
问题描述
我正在使用react native,并且希望将adb切换到wifi以方便调试。
I am working with react native, and would like to switch adb to wifi for easier debugging.
我使用USB连接设备,然后键入以下命令。
I connect my device using usb, then type these commands.
adb tcpip 5555
然后我断开USB电缆并输入此命令
Then I disconnect my usb cable and enter this command
adb connect 192.168.1.6
connected to 192.168.1.6:5555
adb设备会导致以下结果
adb devices result in the following
adb devices
List of devices attached
192.168.1.6:5555 device
因此它仅显示一个连接的设备。
但是尝试使用此命令
So it only shows one device connected. However trying this command
adb reverse tcp:8081 tcp:8081
即使我仅使用adb devices命令显示一个设备,也会出现以下错误
gives me the following error even though only one device is shown with adb devices command as shown above
error: more than one device/emulator
我尝试了此命令,但也遇到了相同的错误
So I tried this command but I also get the same error
adb -s 192.168.1.6:5555 reverse tcp:8081 tcp:8081
error: more than one device/emulator
尝试以下操作会给我同样的错误
Trying the following gives me the same error
adb -s "192.168.1.6:5555" reverse tcp:8081 tcp:8081
adb -s "192.168.1.6" reverse tcp:8081 tcp:8081
adb -s 192.168.1.6 reverse tcp:8081 tcp:8081
甚至尝试使用连接到USB时复制的设备ID也会导致相同的错误
even trying to use the device id which I copied when it was connected to usb resulted in the same error
adb -s deviceid reverse tcp:8081 tcp:8081
是否有办法在无线连接adb时使adb反向工作?
Is there a way to make adb reverse work when adb is connected wireless?
感谢前进。
推荐答案
我对要执行此操作的步骤进行了两项更改。
I made two changes to the steps to get this working.
1)在断开电线连接之前 >从手机上,我运行了 adb反向tcp:8081 tcp:5555
(请注意电话的 5555
端口号)和 adb connect
MY.PHONE.IP.ADDRESS:5555`(带有端口号)。
1) BEFORE disconnecting the wire from my phone, I ran adb reverse tcp:8081 tcp:5555
(note the 5555
port number for the phone) and adb connect
MY.PHONE.IP.ADDRESS:5555` (with port number).
只是现在才断开电线。
然后我安装了该应用程序,尽管如果已安装该应用程序可能会起作用。
Then I installed the app, although it probably would work if the app was already installed.
2)安装应用程序后,出现错误无法加载脚本和无法连接到开发服务器,
2) After the app was installed and I was getting errors "Unable to load Script" and "Could not connect to development server",
- 打开开发者菜单(在打开React Native应用的情况下摇动手机)并选择 Dev Settings。选择调试服务器主机和菜单中的设备端口。
- 在电话的窗口中,输入
MY.COMPUTER.IP.ADDRESS:8081
- opened the developer menu (shake the phone with the React Native app open) and selected "Dev Settings". Selected "Debug server host & port for device" from the menu.
- In the window on my phone I entered
MY.COMPUTER.IP.ADDRESS:8081
现在我可以打开/关闭应用以进行重新加载,然后摇动->远程调试JS。
Now I could open/close the app for a reload, and shake -> debug JS remotely.
这篇关于adb -s 192.168.1.6:5555 .....错误:多个设备/仿真器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!