Saturday, October 24, 2015

ADB on Ubuntu does not recognize Nexus 4


I'm unable to get my Nexus 4 phone recognized by ADB on Ubuntu (12.04 with a newer kernel installed: 3.8.0-30-generic). Developer mode is enabled on the phone.


The device shows up in lsusb:



$ lsusb
...
Bus 003 Device 034: ID 18d1:4ee5 Google Inc.
...


But when I run adb devices I get an empty list. I found many posts on the internet about this problem but none of them solves the problem. There are two solutions.



  • Add a rule to /etc/udev/rules.d/51-android.rules. I found various variation for the content of this file. In most cases a idVendor and idProduct value should be set based on the output of lsusb. Below are some examples that I tried



SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="4ee5", MODE="0666" GROUP="androiddev", SYMLINK+="android%n"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", SYMLINK+="android_adb", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee5", MODE="0666", OWNER="my-login"


After adding this I set the permissions for the rule file to 644 and I rebooted PC/ restarted udev, restarted phone and plugged in my Nexus 4.



  • Add the vendor id to ~/.android/adb_usb.ini.



echo 0x18d1 >> ~/.android/adb_usb.ini

I ran adb devices as root and normal user but I only get an empty list:




$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached


Any ideas on how to solve this problem? Any help of suggestions would be greatly appreciated.



Answer



It's not enough to make the Developer options page appear in the settings menu (by repeatedly tapping the build number). On that page, there's an option USB debugging, which defaults to off.


When USB Debugging is enabled, connecting your device to a PC using USB makes the "USB debugging connected" notification appear, regardless of whether adb is currently running on the PC.



No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...