adb 转发不工作
adb 端口转发对我不起作用,感谢您的见解。 以下命令是我正在尝试的
./adb forward tcp:5985 tcp:5984"
我没有看到任何错误(在 logcat 中),但它只是默默地失败。当我尝试以下命令时 curl localhost:5985
之后,我收到“curl: (56) Recv failure: Connection Reset by Peer”
当我尝试 curl localhost:5984
时,我确实看到一条消息因为我有一个进程在端口 5984(Couchbase 服务器)上运行。
我认为这不是 adb 本身的问题,因为所有其他 adb 命令都可以正常工作。我尝试过的其他事情包括 a)kill-server,然后start-server(也使用sudo模式) b) 重新启动我的机器。
不用说,这些都不起作用。我正在使用 x64 Ubuntu 11.10。
请注意,我正在使用模拟器,并且我的模拟器设备正在运行。 我确实在 logcat 中看到了其他消息,但没有看到这一消息。
谢谢
-Venu
adb port forwarding is not working for me and your insight is appreciated.
The following command is what I am trying
./adb forward tcp:5985 tcp:5984"
I don't see any errors(in logcat) but it just fails silently. When I try the following commandcurl localhost:5985
after that, I get "curl: (56) Recv failure: Connection reset by peer"
When I try curl localhost:5984
, I do see a message as I have a process running on port 5984 (Couchbase server).
I don't think this is an issue with adb itself as all other adb commands are working. Amongst other things I have tried are
a) kill-server followed by start-server (with sudo mode as well)
b) Restarting my machine.
Needless to say, neither of these have worked. I am working on x64 Ubuntu 11.10.
Please note that I am working with the emulator and my emulator device is running.
I do see other messages in logcat just not this one.
Thanks
-Venu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您读过 Google 的这份文档吗?
https://developers.google.com/chrome/mobile/docs/debugging
它解释说,您必须首先确保您可以看到您的设备,
然后在 Android 设备上的 Chrome 中,转到“打开设置”>“高级>开发者工具并选中启用 USB Web 调试选项,如下所示:
然后输入以下命令:
然后执行在桌面上的 Chrome 中访问此 URL:
这有效吗?
Have you read this document from Google?
https://developers.google.com/chrome/mobile/docs/debugging
It explains that you have to first make sure you can see your device with
Then in Chrome on your Android device, go to Open Settings > Advanced > Developer tools and check the Enable USB Web debugging option as shown here:
Then enter the follow command:
And go to this URL in Chrome on your desktop:
Does that work?
对于最初的问题,答案是确保您的设备模拟器正在运行。在 Ubuntu 上,您可以使用:netstat -tan 查看您的开发计算机正在侦听的 TCP 端口。通常端口是5554。当模拟器没有启动时,不会有进程监听这个端口。
On the original question , the answer is to make sure your device emulator is running. On Ubuntu you can use: netstat -tan to see the TCP ports that your development machine is listening on. Usually the port is 5554. When the emulator is not started, there will not be a process listening on this port.
好吧,我终于到了那里。我不确定其中哪一个最终解决了问题(但大多数都有帮助):
/etc/udev/rules.d/##-android.rules
是chmod a +rw
这样我们就不需要sudo adb
并且可以再次编辑它ATTRS{idVendor}
是简单的 4 个十六进制代码(一些页面会鼓励你需要获取完整的 lsusb ####:#### 代码adb devices< /code> 仍然显示
????????????
而不是我的设备代码(但现在可以工作)adb shell
实际上返回一个#
提示adb usb
破坏了它(它没有返回curl
我认为这是对错误的改进,但事实并非如此 - 它使情况变得更糟)Well, I finally got there. I'm not sure which one of these finally fixed the issue (but most are helpful):
/etc/udev/rules.d/##-android.rules
waschmod a+rw
so that we don't need tosudo adb
and can edit it againATTRS{idVendor}
is the simple 4 hex code (some pages will encourage you to take the fulllsusb
####:#### codeSYMLINK+="android_adb"
entry in udevadb devices
still shows????????????
instead of my device code (but works now)adb shell
actually returns a#
promptadb usb
breaks it (it was not returning withcurl
which I thought was an improvement on the error, but no - it breaks it worse)adbforward 中存在一个错误,导致小而快速的数据连接被简单地丢弃
:说,当我使用
curl
尝试上述操作时,数据会通过 - 大概是因为curl
以与(date ; sleep 相同的方式保持套接字打开0.1)
确实如此。There is a bug in adb forward, such that small, fast data connections are simply dropped:
That said, when I try the above with
curl
, that data gets through - presumably becausecurl
holds the socket open in the same way that(date ; sleep 0.1)
does.当我将 Android SDK 平台工具从版本 29.0.2 更新到 29.0.3 时,这个问题开始发生在我身上,
我按照这个 如何降级我的 SDK 版本?
基本上,您需要将 Android SDK Platform Tools 降级到版本 29.0.2:
This issue started happening for me when I updated Android SDK Platform Tools from version 29.0.2 to 29.0.3
I followed this How to downgrade my SDK version?
Basically, you need to downgrade Android SDK Platform Tools to version 29.0.2: