If your Android device is not detected in ADB in Ubuntu and showing error like

List of devices attached
 ????????? (no permissions) follow these instructions

or something like below,

List of devices attached

then below steps may help to solve the issue.

  • Change the first ‘ATTR{idProduct}’ to ‘ATTR{idVendor}’ in the 51-android.rules file. It can be found in /etc/udev/rules.d/51-android.rules.
  • Kill the adb server and start it again using the below commands with sudo permission.
$ sudo adb kill-server
$ sudo adb start-server
$ sudo adb devices