So you’ve been googling for hours, trying and testing why your device isn’t detected by ADB. It’s detected by fastboot, but try as you might, ADB is having none of it. You changed to MTP, PTP, Transfer Files, etc… and it simply won’t appear.
You’ve tested other cables, and the problem remains. You’ve tested your cables on other computers and they work perfectly. You’re tried on other computers and it works just fine.
There are two issues here. Let’s tackle the first one.
ADB stores the fingerprint on the device every time you connect. This is super buggy and the major cause of the issue. The simple method is to never save the fingerprint. If you’ve saved it, then go to Settings -> Developer options -> Revoke USB authorisations.
Does you computer sees your device? It does? Great. Now run:
sudo adb kill-server ; sudo adb devices
This will kill the running server and launch a new one as root. Now your device should be detected:
List of devices attached
You can now use adb as your normal user to send, receive, delete files or get a shell as you would normally do, no more need to sudo or go to root to do operations. The next time you plug in your phone, make sure the authorisation was revoked (or not saved) and that you launch the ADB server as root.
This was tested on multiple FreeBSD systems, the fix might be the same for Linux (if it’s not the udev/permission error).