Android Not getting Detected in Ubuntu Systems

I had android studio installed on my Ubuntu Version , and to run / test the android project I was trying to connect my android Device , following are the steps that if followed will help us in doing so .

Prerequisites :

  • android Device
  • Demonstration is for Ubuntu users with android studio

Here it goes :

1) create file /etc/udev/rules.d/51-android.rules

sudo gedit /etc/udev/rules.d/51-android.rules

2) copy and paste contents below:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666", GROUP="plugdev"    
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666", GROUP="plugdev"  
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666", GROUP="plugdev" 

3) Run the following command to change file permissions:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

4) connect your phone via usb and run the following command:

lsusb

Look for your device(s) Example (Nexus 5):

Bus 003 Device 074: ID 18d1:4ee7 Google Inc.

For Nexus 5, Vendor ID is 18d1, mine is on Bus “003” If you don’t see a change when you plug in your device with lsusb, perhaps your USB cable is charge-only.

5) Now reload the rules with the following commands:

sudo udevadm control --reload-rules
sudo service udev restart
sudo udevadm trigger

6) Verify device is now allowing plugdev user group access

ls -l /dev/bus/usb/<bus number from step 4>

Example:

ls -l /dev/bus/usb/003

crw-rw-rw- 1 root plugdev 189, 329 Jul  3 18:23 074

7) Run adb devices to confirm permissions are correct and enjoy!

Note: if you haven’t created the plugdev group and added your user name to it (if permission denied prepend “sudo” following commands):

1) add plugdev group:

groupadd plugdev

2) add your username to plugdev group (useradd -G {group-name} username):

useradd -G plugdev billy

3) restart udev (you may need to log off and log back in to update user group):

sudo service udev restart



 enabled the developer mode on the phone?

If not go to the settings on the phone and touch, I am not sure what line to touch but I think the line that shows the build number. Touch that line 10 times. If it worked, the android shows you a message like “You are developer now.”

There is a new line at the bottom of the settings in the phone. Like “developer options”. Touch that. Now enable the usb debug option.

When you do that, your phone should be available in android studio.

 

in any case we are still facing the issue please write down will get back with the possible help .

 

 

Related

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »
[huge_it_videogallery id="2"]
Close