Translate

[SOLVED] Eclipse can’t see my Android Device on Ubuntu

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.

#!/bin/bash
# android_device_reset script
sudo adb kill-server
sudo service udev stop
sudo adb start-server
sudo adb devices

Save it and make it executable

chmod +x android_device_reset

2. Open this file /etc/udev/rules.d/51-android.rules

Make sure it looks something like this

SUBSYSTEMS=="usb", SYSFS{idVendor}=="0bb4", MODE=="0666"
SUBSYSTEMS=="usb", SYSFS{idVendor}=="22b8", MODE=="0666"

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

android_device_reset

It’ll ask you for your password, only administrative users will be able to execute the script.

Hope this helps.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

12 Responses to “[SOLVED] Eclipse can’t see my Android Device on Ubuntu”

  1. Daniel Says:

    Thank you it worked for me and my Nexus S!

  2. binary Says:

    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!

  3. jason cigar Says:

    excellent !!!….
    thank you very much…worked for my lg p500…..

  4. gubatron Says:

    put the script somewhere on your $PATH

  5. ernesto Says:

    @binary

    make this:

    #!/bin/bash
    # android_device_reset script
    sudo ./adb kill-server
    sudo service udev stop
    sudo ./adb start-server
    sudo ./adb devices

  6. Mina Samy Says:

    Hi

    I have the same problem but on Windows 7 with Huawei U8230.

    can you tell me how to solve this ??

    thanks

  7. Splittime Says:

    This also worked for me and a Samsung Galaxy Tab.
    Thank you very much!

  8. Mihai Says:

    Worked very well for Nexus S .
    Thank you.

  9. dig fun Says:

    Thanks!!!

  10. Sukhbir Says:

    (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….?

  11. gubatron Says:

    /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

  12. Vincenzo Says:

    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.

Leave a Reply