1

My USB-connected Android phone (a Redmi Note 4, not that it matters) is not being displayed by adb devices. I'm aware of this question on the subject. But in my case the odd thing is that the device is visible in Chrome devtools, and I can "Inspect" webviews. Obviously, I've set USB debugging on on the device. All my Windows USB drivers are installed properly. I've done adb kill-server && adb start-server. I've put the device into MTP/PTP USB mode. I've tried any number of combinations of cables and ports and sequences of plugging in and unplugging and turning USB debugging on and off again. The device is visible under "Portable Devices" in Device Manager.

Things were working fine up until a few days ago. I can think of nothing obvious that changed in the meantime.

After first posting this question, things started working again by accident--I cannot remember the sequence of things I did. Then just recently, the problem reared its ugly head again.

What could account for this state of affairs?

  • 1
    close all instances of `chrome` then do `adb kill-server` and then try `adb devices` again – Alex P. May 26 '17 at 20:42
  • Were you able to see it before, and it's just not working now? Or is it the case where you were never able to see it? Also, are you able to see it in your Windows devices list? In my experience, the device shows up as a flash drive – Jeeter May 26 '17 at 20:47
  • Sometimes you get prompted to allow a device debugging connection certificate on your phone. Has this maybe expired/cleared? – IAmGroot Jun 19 '17 at 12:11
  • @AlexP Thanks, but that didn't help. Are you saying there may be some kind of interaction between Chrome and adb? –  Jun 19 '17 at 12:16
  • @Doomsknight Yes, that prompt comes up whenever I connect after revoking the permissions, so I am quite sure the PC and the device are talking at least that much, and that the permissions are in place. –  Jun 19 '17 at 12:20
  • Thanks @AlexP., that did the trick for me. – demaniak Jun 19 '18 at 08:56

2 Answers2

0

In Your case, the simple and tested solution for Xiaomi Phones.

Go to developer options, scroll down to bottom and turn of MIUI Optimization. It would then visible in your android studio.

UMESH0492
  • 1,701
  • 18
  • 31
-1

Did you tried to add VendorID for your device ? for that please do the following: Run below on terminal to find your VENDOR ID; lsusb

    Find your phones vendor id (it will be probably without any company names) and type,

        sudo gedit ~/.android/adb_usb.ini

    and your adb_usb.ini file should look like:

    # ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
    # USE 'android update adb' TO GENERATE.
    # 1 USB VENDOR ID PER LINE.
    # ie 0x2207
    0x<Add Your Vendor ID here>

    Disconnected and reconnected device and also needed to run below commands on terminal;

        sudo adb kill-server && adb start-server
Blake
  • 57
  • 5