在手机上部署和调试 Android 应用程序时出现间歇性问题

发布于 2024-10-20 21:35:22 字数 683 浏览 6 评论 0原文

我目前正在调查一个问题,由于某种原因 eclipse 插件/adb 失去了与我手机的连接,并向我显示消息:

[2011-03-05 22:53:40 - projectOne] 尝试将调试器连接到 'com.testbed .input' 在端口 8633 上 [2011-03-05 23:04:02 -projectOne] ------------------------------------------ [2011-03-05 22:40:42 - projectOne] Android 发布! [2011-03-05 22:40:42 - projectOne] adb运行正常。 [2011-03-05 22:40:42 - projectOne] 执行 com.testbed.input.MainActivity 活动启动 [2011-03-05 22:40:42 - projectOne] 自动目标模式:无法检测设备兼容性。请选择目标设备。

在设备监视器日志上我看到:

[2011-03-05 23:10:13 - Logcat]设备(HT971L900496)请求被拒绝:设备离线 java.io.IOException:设备(HT971L900496)请求被拒绝:设备离线

我不知道它是什么,它只是有一天完美地工作,然后我得到了这个。我希望对工具链有更专业知识的人能够提供帮助,因为它确实减慢了我的速度,所以我决心弄清楚这一点。

非常感谢

I am currently investigating a problem I have where for some reason eclipse plugin/adb loses connection to my phone and gives me the message:

[2011-03-05 22:53:40 - projectOne] Attempting to connect debugger to 'com.testbed.input' on port 8633
[2011-03-05 23:04:02 - projectOne] ------------------------------
[2011-03-05 22:40:42 - projectOne] Android Launch!
[2011-03-05 22:40:42 - projectOne] adb is running normally.
[2011-03-05 22:40:42 - projectOne] Performing com.testbed.input.MainActivity activity launch
[2011-03-05 22:40:42 - projectOne] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.

And on the device monitor log I see this:

[2011-03-05 23:10:13 - Logcat]device (HT971L900496) request rejected: device offline
java.io.IOException: device (HT971L900496) request rejected: device offline

I cant figure out what it is, it just works flawless one day and next I get this. I hope someone with a more expert knowledge of the tool chain can help as its really slowing me down so I am determined to get to the bottom of this.

Many thanks

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

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

发布评论

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

评论(4

还如梦归 2024-10-27 21:35:22

我可以确认间歇性的“adb devices”问题可以归因于使用了错误的 USB 端口。
我觉得和各个端口的功率输出有关系(即功率不够)。
我在与 Android Note II(三星 Note 2 克隆版)的 USB 连接方面遇到了间歇性问题,持续了一周。
我不相信所有 Google 文章都说要使用不同的 USB 插座,
因为我认为除了联想 Thinkpad L420 右前方的两个之外,我没有其他任何东西。
你猜怎么着,最后仔细检查背面后,发现它在最末端有一个 USB 插座。
插入该插座后,“adb devices”始终会列出该设备。
万岁!
为了其他(Ubuntu)用户的利益,我展示了让“adb devices”工作的技巧。

  1. 弄清楚 Ubuntu Linux 如何识别该设备。
    插入设备,执行“lsusb”,然后使用设备的第一个十六进制数字(此处为“0bb4”)
    作为名为“/etc/udev/rules.d/99-android.rules”的文件中的“idVendor”属性,
    包含以下一行内容:
    子系统==“usb”,ATTR {idVendor}==“0bb4”,MODE =“0666”,GROUP =“plugdev”
    ** 不要在该行的逗号后面添加空格。
    然后,“sudo service udev restart”。
  2. 不要忘记将自己添加到“plugdev”组:“sudo usermod -aGplugdev”。
  3. 执行:adb Kill-server; adb 启动服务器;亚行设备。
    adb 服务器侦听端口 127.0.0.1:5037 (netstat -anp|grep LISTEN)。
    因此,如果任何 adb 命令挂起,请检查您是否可以“ping 127.0.0.1”。
    如果 localhost ping 失败,请检查防火墙并检查“sudo iptables-save”,
    寻找本地主机(“lo”)缺少的“允许”规则。
    此外,“ifconfig -a”将显示本地主机接口是否已启动(Google“ifup”)。

我希望其他人发现此信息有用。

I can confirm that intermittent "adb devices" problems can be put down to using the wrong USB port.
I think it has something to do with the power output of the various ports (i.e. not enough power).
I had intermittent problems with USB connection to Android Note II (Samsung Note 2 clone) for a week.
I didn't believe all the Google articles saying to use a different USB socket,
because I didn't think I had any others than the two on the front right of my Lenovo Thinkpad L420.
Guess what, after finally checking the back carefully, there it is, a single USB socket on the very end.
After plugging into that socket, "adb devices" always lists the device.
Hooray!
For the benefit of other (Ubuntu) users, I am showing my tips for getting "adb devices" to work.

  1. Figure out how the device is recognized by Ubuntu Linux.
    Plug in the device, do "lsusb" then use the first hex number of the device ("0bb4" here)
    as the "idVendor" attribute in a file called, "/etc/udev/rules.d/99-android.rules",
    with the following, one-line contents:
    SUBSYSTEM=="usb",ATTR{idVendor}=="0bb4",MODE="0666",GROUP="plugdev"
    ** Do not put spaces after the commas in this line.
    Then, "sudo service udev restart".
  2. Don't forget to add yourself to the "plugdev" group: "sudo usermod -aG plugdev".
  3. Execute: adb kill-server; adb start-server; adb devices.
    The adb server listens on port 127.0.0.1:5037 (netstat -anp|grep LISTEN).
    So if any adb command is hanging, check that you can "ping 127.0.0.1".
    If localhost ping fails, check firewalls and also check "sudo iptables-save",
    looking for a missing "allow" rule for localhost ("lo").
    Also, "ifconfig -a" will expose whether localhost interface is up (Google "ifup").

I hope someone else finds this information useful.

残龙傲雪 2024-10-27 21:35:22

我不知道为什么会发生这种情况,但我找到了一个快速补救措施 - 首先杀死所有 adb 进程。

然后使用命令“adb start-server”再次启动 adb。

这样我就可以再次连接到手机

I don't know why it happens but I have found a quick remedy - first kill any adb process.

Then start the adb again with the command 'adb start-server'.

This then allows me to connect to the phone again

暗恋未遂 2024-10-27 21:35:22

我为其他人找到的另一条信息:
http://groups.google.com/group/android-developers/browse_thread /thread/5fb922c2166eab68

我将 USB 插入计算机的正面,但遇到了问题 - 将其直接插入背面的 USB 控制器而不是集线器后,它变得更加可靠。

Another nugget of information for others that I found:
http://groups.google.com/group/android-developers/browse_thread/thread/5fb922c2166eab68

I had the usb plugged into the front of my computer and I was experiancing problems - after pluging it at the back direct to the usb controller and not a hub it has become much more reliable.

暗恋未遂 2024-10-27 21:35:22

我也有同样的问题。这是我的解决方案:您必须在按下手机电源按钮的同时将 USB 线从 PC 连接到手机。

I had the same problem. Here is my solution: you have to connect the USB cable from your PC to your phone while pressing the power button of you phone.

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