tags:

views:

309

answers:

2

Hi!

I've been making some apps for android for quite a while but I've only been using windows 7. Due to some reasons sometimes I'm forced to program in linux so I followed the guide to configure the SDK and eclipse (http://developer.android.com/guide/developing/device.html).

After that I ran "adb devices" and got this:

List of devices attached 
???????????? device

As you can see the name is unknown but this also happens in windows so I didn't fret too much over it.

Then I launched eclipse and made a very simple project to test the deployment but here two things happened:

1st- It doesn't detect the android SDK version. (http://img515.imageshack.us/img515/5611/escolha.jpg)

2nd- when I try to deploy I get the following output:

[2010-10-09 23:06:45 - testeAndroid] Android Launch!
[2010-10-09 23:06:45 - testeAndroid] adb is running normally.
[2010-10-09 23:06:45 - testeAndroid] Performing com.examples.teste.teste activity launch
[2010-10-09 23:06:45 - testeAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-10-09 23:09:50 - testeAndroid] WARNING: Unknown device API version!
[2010-10-09 23:09:50 - testeAndroid] Uploading testeAndroid.apk onto device '????????????'
[2010-10-09 23:09:50 - testeAndroid] Failed to upload testeAndroid.apk on device '????????????'
[2010-10-09 23:09:50 - testeAndroid] com.android.ddmlib.AdbCommandRejectedException: device not found
[2010-10-09 23:09:50 - testeAndroid] Launch canceled!

I'm using:

eclipse 3.5.2

adt 0.9.9

android SDK tools r7

android phone: vodafone 845 = Huawei U8120 - android 2.1-update1

Any idea for what is happening?

thanks in advance ;)

A: 

You have to update your udev rules according to the manual on http://developer.android.com/guide/developing/device.html - then it will work.

mreichelt
Thanks for the reply but I already did that. As you can see in my question the device already appears when I do "adb devices" and I can even use adb push, pull and install commands. The only problem is when I try to deploy the application in eclipse which I need for proper debugging...
RicardoSBA
Of course, but as it seems the udev rules still aren't correct (you get ??????????? as the device name). I think you should get the vendor's id by running 'lsusb' on the console while the device is attached to your computer and change the udev rules accordingly. Then restart udev and replug your phone, and it should work. :-)
mreichelt
It really was a bug in the adb listing name when no device SN was supplied as explained in the other answer. Apparently eclipse or the adt plug-in don't like the '???????' name :P
RicardoSBA
Ahh - that explains a lot! :-) It's really odd that some phones seem to behave like that...
mreichelt
+2  A: 

The Huawei U8120 (Vodafone 845) phone is one of those USB devices that present themselves as USB storage devices to the host operating system to serve up files for Windows driver installation. To switch them into the USB slave from Linux mode you need to use usb_modeswitch. You can download the latest usb_modeswitch package from the homepage, it includes support for your device. Or just use this call on the command line:

$ sudo usb_modeswitch -v 0x12d1 -p 0x1031 -s 20 -M "55534243123456780600000080000601000000000000000000000000000000"

However to use it with the Android tools you need to solve another problem, because the Huawei U8120 (Vodafone 845) provides no serial number. There might be other workarounds, but the one that made it work for me is a patch for the "adb" utility that can cope with devices that have no serial number.

$ ./tools/adb devices

List of devices attached

noserial-/dev/bus/usb/001/036 device

The patch is here: https://review.source.android.com/#change,13552 and here you can find an "adb" binary if you trust that source :) www.mediafire.com/?oizmyyw0wwz

see also code.google.com/p/android/issues/detail?id=4365

(sorry, was only allowed to post "one hyperlink")

ofrommel
Many thanks!!! :D The device was already in the correct mode so usb_modeswitch was not needed (that is, it came by default in ubuntu 10.10 and it changes automatically to the correct mode according to dmesg). What really solved the problem was the patched adb. It's unbelievable that such bug still exists after so many months of its finding :S
RicardoSBA