Are you seeing this on eclipse when you plug your Android device to your Ubuntu box?
Serial Number: ??????????
AVD Name: N/A
Target: unknown
State: ??
Here’s the solution:
1. Create a script to fix this next time it happens, let’s call it “android_device_reset” and save it on a folder contained on your $PATH environment variable.
[bash]
#!/bin/bash
# android_device_reset script
sudo adb kill-server
sudo service udev stop
sudo adb start-server
sudo adb devices
[/bash]
Save it and make it executable
[bash]chmod +x android_device_reset[/bash]
2. Open this file /etc/udev/rules.d/51-android.rules
Make sure it looks something like this
[bash]
SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", MODE=="0666"
SUBSYSTEMS=="usb", SYSFS{idVendor}=="22b8", MODE=="0666"
[/bash]
Each line represents a different android device. If you have just one, the file should be one line long.
On that example I’ve configured the rules for a Motorola Droid and a Nexus One.
If you need to know the idVendor numbers for your Android device go here
developer.android.com/guide/developing/device.html#VendorIds
3. Whenever the problem happens, just open a terminal and type
[bash]android_device_reset[/bash]
It’ll ask you for your password, only administrative users will be able to execute the script.
Hope this helps.
Thank you it worked for me and my Nexus S!
can you tell me where to put this script? i’m on a debian squeeze machine. i put the script in the “/etc/” folder and when i execute it, it tells me:
adb: command not found
Stopping the hotplug events dispatcher: udevd.
and please tell me if i have to write:
SUBSYSTEMS==”usb”, SYSFS{idVendor}==”0bb4″, MODE==”0666″
or:
SUBSYSTEMS==”usb_device”, SYSFS{idVendor}==”0bb4″, MODE==”0666″
since i’m not on ubuntu (i know it’s based on debian).
many thanks!
put the script somewhere on your $PATH
excellent !!!….
thank you very much…worked for my lg p500…..
@binary
make this:
#!/bin/bash
# android_device_reset script
sudo ./adb kill-server
sudo service udev stop
sudo ./adb start-server
sudo ./adb devices
Hi
I have the same problem but on Windows 7 with Huawei U8230.
can you tell me how to solve this ??
thanks
This also worked for me and a Samsung Galaxy Tab.
Thank you very much!
Worked very well for Nexus S .
Thank you.
Thanks!!!
(1)……
/etc/udev/rules.d/51-android.rules
the above file not found….
the “rules.d” folder contains only these files given below:
11-hplj10xx.rules 70-persistent-cd.rules README
40-hplip.rules 70-persistent-net.rules
(2)……..
Whenever the problem happens, just open a terminal and type
android_device_reset
but this results that “command not found”
I have made the same script as told and set the path already…..
Can anybody help regarding these two problems….?
/etc/udev/rules.d/51-android.rules not there?
I guess things must have changed with all the updates ever since.
you should probably read this
http://developer.android.com/guide/developing/device.html
Thanks, it worked for me on Archlinux 64 bit. I had only to adjust the command in android_device_reset accordingly to my system:
sudo /home/vincenzo/android-sdk-linux_x86/platform-tools/adb kill-server
sudo /etc/rc.d/udev stop
sudo /home/vincenzo/android-sdk-linux_x86/platform-tools/adb start-server
sudo /home/vincenzo/android-sdk-linux_x86/platform-tools/adb devices
but this is also because the android-sdk folder is not in my path.
It was not working until I removed the ‘sudo’ from the lines.
After that it worked perfectly. Thank you
Thanks, it worked for me on Ubuntu 11.10 32 bit.
It works for my galaxy S
I’ve try many ways to make it works and after a lot of changes and resets, I never achived to make it works.
But YOUR script for reset adb connection is magic, and it works like a charm 🙂
This solved my problem. Thank you!
Thanks, worked for my optimus L9…..on Ubuntu 12.04(64bit)
but has to configure(add) adb to $PATH
Super! Thanks, worked for me, after I updated my Xubuntu to 14.04.
###### Linux Mint 17 ######
cd ~/home/user
Create file android_device_reset and add:
#!/bin/bash
# android_device_reset script
sudo adb kill-server
sudo service udev stop
sudo adb start-server
sudo adb devices
Close file and execute: chmod +x android_device_reset
Insert the phone’s USB cable
Create file /etc/udev/rules.d/51-android.rules, if there is no. And add
SUBSYSTEMS==”usb”, SYSFS{idVendor}==”XXXX”, MODE==”0666″
SUBSYSTEMS==”usb”, SYSFS{idVendor}==”XXXX”, MODE==”0666″
After execute the command: lsusb
Replace ID xxxx:xxxx in the file 51-android.rules following the sequence. save and close file.
cd ~/home/user and execute the command: ./android_device_reset
Remove and replace the phone’s USB cable. Done now open the eclipse.
I hope this helps someone.