Sunday, October 25, 2015

Setup Hardware Devices debugging for Android Studio on Ubuntu 15.10

This video show how to setup /etc/udev/rules.d/51-android.rules in Ubuntu (behind VirtualBox) to enable hardware device debugging in Android Studio.

The development platform is 64-bit Ubuntu-GNOME 15.10 running in VirtualBox, with Android Studio installed with Ubuntu Make (umake).

To enable hardware device debugging in Ubuntu, you have to create /etc/udev/rules.d/51-android.rules file to add device IDs for your debugging devices. (refer: Android Developers Document Using Hardware Devices - Setting up a Device for Development)

Create /etc/udev/rules.d/51-android.rules file with sudo right, add the line and save:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
where "18d1" is the USB Vendor ID for Google, Nexus 7 in my case.

Run the command:
$ sudo chmod a+r /etc/udev/rules.d/51-android.rules

This video show how to, behind VirtualBox.


Sacro Macello said...

Hi, thank you for the post.
I followed tour tut but my USB device isnnot detected in android studio, but detected by the system. I am using your same distro and followed also your other tut.

Andr.oid Eric said...

hello Sacro Macello,

What is your device? Have you fixed the idVendor?

Sacro Macello said...

Yes, i've done all, now my string it's:
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8",ATTR{idProduct}=="2e82", MODE="0666", GROUP="plugdev"
My phone is a Motorola Motog 2nd edition (2014).
I've tried all the possible types of string in file 51-android.rules, every possible string found on different tuts but nothing shows to me when I type "adb devices"....

Andr.oid Eric said...

Have you enable Developer Option on your phone?

Sacro Macello said...

I am developing applications for android for about 3 years, so i know what I have to enable to start debugging with android devices... I think at 99% it is a ubuntu problem!