开发者

Android - unable to install/debug an application in Eclipse on Ubuntu, while ADB works

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 including SYSFS{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 app开发者_StackOverflowlication 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.


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:

SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="1354", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", SYSFS{idProduct}=="d00d", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", SYSFS{idProduct}=="0c87", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="1004", SYSFS{idProduct}=="618e", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="681c", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", SYSFS{idProduct}=="4e12", MODE="0666"

and restart your ubuntu. This adds some common HTC devices (including Nexus One).


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/


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

SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜