The time I tried my first Hello World Android application on emulator is Mar 2010, which is totally one year ago, but now I am still wandering around, even my heart beats always show me how I love android, and how deep I believe it's the trend of the future. However, I didn't make any progress, or make any individual application for the last year. There are so many reasons for this embarrassing result, but one of them, the very important one is I can't connect android phone with my Ubuntu system under debugging mode, even I tried a lot of ways.
Today, I finally solved this problem, here are the steps you should follow:
- Make your project as "debuggable". In the AndroidManifest.xml file, add
android:debuggable="true"
to the
element. - Turn on "USB Debugging" on your android phone.
- Setup the system to detect your device.
- Create new file as root: /etc/udev/rules.d/51-android.rules
- Edit the new file: SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"; #Here I tried to use Samsung's idVendor, but it's totally wrong.
- Don't forget to save it.
- Change the permission: sudo chmod a+r /etc/udev/rules.d/51-android.rules
- Here, I tried to restart the server by
- adb kill-server
- adb start-server
- adb kill-server
- Break;
- Test your connection: adb devices, which is from SDK platform-tools/ directory.
List of devices attached
The sequence of # is the serial number of your device.
########## device - END;
- You could also check your USB connection:
sudo lsusb -v | grep -C5 4e22
Bus 002 Device 003: ID 18d1:4e22
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x18d1
idProduct 0x4e22
bcdDevice 2.27
iManufacturer 1 Samsung
iProduct 2 Nexus S
iSerial 3 30308909D7B600EC
bNumConfigurations 1
Hope this will be useful for other developer who is struggling with this problem.
No comments:
Post a Comment