Intermittent problems deploying and debugging android app to phone
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] Attemp开发者_如何学JAVAting 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
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.
- 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".
- Don't forget to add yourself to the "plugdev" group: "sudo usermod -aG plugdev".
- 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.
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
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.
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.
精彩评论