1

Based on react native documentation (https://facebook.github.io/react-native/docs/running-on-device) I wanted to connect to ADB in my ubuntu vm (Ubuntu 18.04.2 LTS) but my problem is that i keep getting an empty list.

So what steps I have followed :

  1. lsusb to extract mobile model (in my case 2a45)

devnull@greg_server:~$ lsusb

Bus 001 Device 004: ID 2a45:2008 Meizu Corp. MX Phone (MTP)

Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

  1. input this into your udev rules in order to get up and running

echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules

  1. show adb list

devnull@greg_server:~$ adb devices

List of devices attached

In order to troubleshoot based on

“List of devices attached” is empty on Ubuntu 16.04 using "adb devices"

I followed the below steps :

  1. created adb_usb.ini file and restarted adb server

devnull@greg_server:~$ cat ~/.android/adb_usb.ini

0x2a45

devnull@greg_server:~$ adb kill-server

devnull@greg_server:~$ adb start-server;

daemon not running; starting now at tcp:5037

daemon started successfully

devnull@greg_server:~$ adb devices

List of devices attached

  1. enabled usb debugging and checked again adb devices

In this case I noticed that lsusb doesn't identify my mobile and adb devices command returns again an empty list as shown below

devnull@greg_server:~$ lsusb

Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

devnull@greg_server:~$ adb devices

List of devices attached

  1. checked android usb file configuration

root@greg_server:/etc/udev/rules.d# pwd

/etc/udev/rules.d

root@greg_server:/etc/udev/rules.d# ls -lst

total 64

4 -rw-r--r-- 1 root root 71 Oct 24 07:18 51-android-usb.rules

60 -rw-r--r-- 1 root root 58549 May 8 06:28 70-snap.core.rules

root@greg_server:/etc/udev/rules.d# cat 51-android-usb.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", MODE="0666", GROUP="plugdev"

Any help on what might be the case?

gmavridakis
  • 109
  • 9
  • Check the authorization in your phone, you should authorize your computer to access your device – Rebai Ahmed Oct 24 '19 at 08:34
  • 2
    Try also to disable developer options and enable back again. Before you do that also unplug usb from phone. After that enable also usb debugging and you should see "Allow this computer to access ..." dialog.. This should work.. – mmmatey Oct 24 '19 at 08:38
  • @mmmatey suggestion did it for me. Thanks! – JAponte May 18 '20 at 06:04

1 Answers1

1

I'm attempting to get ADB up and running on an older version of ubuntu, but my problems are more fundamental (I'm trying to do this in Virtualbox as well).

However - I noticed that this answer didn't contain something which has fixed the issue for others - the USB configuration mode (a developer option which should be under the dev settings somewhere).

On the device I'm using, this was under "Default USB Configuration" - advice from others appears to be that selecting PTP is the way to go.

Hope that might help out.

AndyW
  • 41
  • 5