Android - 在 ADB 工作时无法在 Ubuntu 上的 Eclipse 中安装/调试应用程序
我有 Pulse U8220 手机,我正在其上进行 Android 开发。最近,我开始在 Ubuntu 上使用 Eclipse 时遇到问题,因为 Eclipse 拒绝在我的设备上运行/调试程序(我不确定为什么)。这过去对我有用。
我已经完成了最重要的步骤,例如:
- 创建
/etc/udev/rules.d/50-android.rules
并包含SYSFS{idVendor}=="12d1"
华为设备 - 对于运行 sudo adb Kill-server && 的 sudo asb start-server
但是这些都不能解决 Eclipse 中的问题。请注意,adb 本身可以正常工作。
每当我尝试在设备上的 Eclipse 中运行应用程序(Eclipse 显示为“在线”)时,控制台都会列出以下内容:
[2011-03-15 15:45:45 - myapp] Android Launch!
[2011-03-15 15:45:45 - myapp] adb is running normally.
[2011-03-15 15:45:45 - myapp] Performing my.app.Activity activity launch
[2011-03-15 15:45:45 - myapp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-03-15 15:45:47 - myapp] WARNING: Unknown device API version!
[2011-03-15 15:45:47 - myapp] Uploading myapp.apk onto device '????????????'
[2011-03-15 15:45:47 - myapp] Failed to install myapp.apk on device '????????????': adb rejected install command with: device not found
[2011-03-15 15:45:47 - myapp] com.android.ddmlib.AdbCommandRejectedException: device not found
[2011-03-15 15:45:47 - myapp] Launch canceled!
但是,我仍然可以从控制台使用 adb 安装应用程序,如下:
$ ant install
...
[echo] Installing /projects/myapp/bin/myapp-debug.apk onto default emulator or device...
[exec] 154 KB/s (88178 bytes in 0.558s)
[exec] pkg: /data/local/tmp/myapp-debug.apk
[exec] Success
它在台式机上的 Windows 上正常工作,我必须安装 USB 驱动程序,但我主要在我的 Ubuntu 笔记本电脑上工作。我有一种感觉,这可能与我的设备有一个奇怪的“序列号”有关 - “????????????”。
有人有这个问题吗?有人设法解决它吗?是否可以调试未在 Eclipse 中启动的 Android 应用程序?
已解决:感谢 PaulB 向我指出 Modaco 论坛,我在其中找到了一个已修补的 adb 链接,该链接可以正确处理没有序列号的设备。不需要其他修改和命令。现在,我也可以在 Ubuntu 上的 Eclipse 中运行和调试应用程序。
I have the Pulse U8220 phone, on which I'm doing Android development. Recently I started having problems with Eclipse on Ubuntu, because Eclipse refuses to run/debug programs on my device (and I'm not sure why). This used to work for me in the past.
I have already done the most important steps like:
- creating
/etc/udev/rules.d/50-android.rules
and includingSYSFS{idVendor}=="12d1"
for a Huawei device - running
sudo adb kill-server && sudo asb start-server
But neither of these resolve the issue in Eclipse. Note that adb itself works correctly.
Whenever I try to run my application in Eclipse on a device (which Eclipse shows as 'Online'), the console lists the following:
[2011-03-15 15:45:45 - myapp] Android Launch!
[2011-03-15 15:45:45 - myapp] adb is running normally.
[2011-03-15 15:45:45 - myapp] Performing my.app.Activity activity launch
[2011-03-15 15:45:45 - myapp] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2011-03-15 15:45:47 - myapp] WARNING: Unknown device API version!
[2011-03-15 15:45:47 - myapp] Uploading myapp.apk onto device '????????????'
[2011-03-15 15:45:47 - myapp] Failed to install myapp.apk on device '????????????': adb rejected install command with: device not found
[2011-03-15 15:45:47 - myapp] com.android.ddmlib.AdbCommandRejectedException: device not found
[2011-03-15 15:45:47 - myapp] Launch canceled!
However, I am still able to install the application using adb from the console, as follows:
$ ant install
...
[echo] Installing /projects/myapp/bin/myapp-debug.apk onto default emulator or device...
[exec] 154 KB/s (88178 bytes in 0.558s)
[exec] pkg: /data/local/tmp/myapp-debug.apk
[exec] Success
It works normally on Windows on a desktop machine, where I had to install the USB drivers, but I work mostly on my Ubuntu laptop. I have a feeling that this may be be related to the fact, that my device has a strange 'serial' number - '????????????'.
Does anybody have this problem? Did anybody manage to solve it? Is there a possibility to debug an Android application, that was not started in Eclipse?
Solved: Thanks to PaulB for pointing me to the Modaco forum, where I found a link to a patched adb which correctly handles devices without a serial number. No other modifications and commands were necessary. Now, I can run and debug applications in Eclipse on Ubuntu too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这是 ubuntu 上 adb 的常见问题,您作为用户缺乏访问通过 USB 连接的手机的权限。要解决此问题,您有两种可能性,首先是快速破解:
(1) sudo $ANDROID_HOME/tools/adb Kill-server && sudo $ANDROID_HOME/tools/adb 启动服务器
在终端中。但这必须在每次启动 ubuntu 时完成。
(2) 设置正确的访问权限:
创建文件
/etc/udev/rules.d/51-android.rules
:并重新启动 ubuntu。这添加了一些常见的 HTC 设备(包括 Nexus One)。
Thats a common issue with adb on ubuntu, you as a user are lacking the rights to access the phones connected via usb. To fix this you have two possibilities, first the quick hack:
(1)
sudo $ANDROID_HOME/tools/adb kill-server && sudo $ANDROID_HOME/tools/adb start-server
in a Terminal. But this has to be done everytime you start your ubuntu.
(2) setting the proper access rights:
create a file
/etc/udev/rules.d/51-android.rules
:and restart your ubuntu. This adds some common HTC devices (including Nexus One).
也许你需要这样做:
usb_modeswitch -W -v 12d1 -p 1030 -V 12d1 -P 1034 -M "5553424370ab71890600000080010a11060000000000000000000000000000" -s 20
更多讨论http://android.modaco.com/content/t -mobile-pulse-mini-pulsemini-modaco-com/308255/adb-and-pulse-mini/
Perhaps you need to do :
usb_modeswitch -W -v 12d1 -p 1030 -V 12d1 -P 1034 -M "5553424370ab71890600000080010a11060000000000000000000000000000" -s 20
More discussion at http://android.modaco.com/content/t-mobile-pulse-mini-pulsemini-modaco-com/308255/adb-and-pulse-mini/
是的,我也遇到了类似的问题,我的 HTC 显示为 ?????????我在 google 上为我的 HTC 搜索了 udev/rules.d 的修复程序。对我来说,这是一个权限问题,udev/rules.d 修复了这个问题,我的设备现在显示在 ddms 和 Eclipse 中。这是我放在“/etc/udev/rules.d/51-android.rules”文件中的内容
SUBSYSTEMS==“usb”,ATTRS{idVendor}==“0bb4”,ATTRS{idProduct}==“0ff9” ,MODE =“0666”,OWNER =“apesa”#Normal Heroc
子系统==“usb”,ATTRS {idVendor} ==“0bb4”,ATTRS {idProduct}==“0c9a”,MODE =“0666”,OWNER =“apesa”#调试&恢复英雄
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0fff", MODE="0666", OWNER="apesa" #Fastboot Heroc
顺便说一句:我正在运行相同的设置。
Yes, I had a similar issue with my HTC showing up as ????????? I googled a fix for udev/rules.d for my HTC. For me it was a permissions issue and udev/rules.d fixed that and my device now shows up in ddms and Eclipse. Here is what I placed in my "/etc/udev/rules.d/51-android.rules" file
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ff9", MODE="0666", OWNER="apesa" #Normal Heroc
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c9a", MODE="0666", OWNER="apesa" #Debug & Recovery Heroc
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0fff", MODE="0666", OWNER="apesa" #Fastboot Heroc
BTW: I am running the same setup.
我有同样的问题,现在我解决了,
你需要一个新的adb文件而不是google提供的
下载链接:http://download.csdn.net/download/qq280948982/3791652
中国人修改它。如果您没有scdn帐户,可以联系我
I have the same Problem,and now i solve it,
you need a new adb file not google Provide's
download link: http://download.csdn.net/download/qq280948982/3791652
a chinese people modify it. if you don't have scdn account,you can contact to me