I have Nexus 5X, and I had everything working but suddenly
I can only charge the phone but I can't see it on the computer.
I tried 2 different cables and 3 different computers and OS(Windows 7, 8, and Ubuntu)
And I checked and the device is in MTP mode.
I even tried with adb/recovery/fastboot(in the bootloader)
these are the device properties:
Android version: 6.0 Marshmallow.
Build number: MDB08L.
Kernel: 3.10.73-g60cf314.
btw, I checked in dmesg
on my ubuntu when I connected and I've found this:
[36357.340506] usb 1-2: new low-speed USB device number 19 using xhci_hcd
P.S. I even tried doing a factory reset and it didn't helped.