[ONE Q&A, Help & Troubleshooting] lookcrabs:
Solved for me at least (ADB in arch is out of date)

EDIT:: TLDR: It's adb for sure. Download the latest version from google via HERE (direct link here

So I know this doesn't really add to the issue but I think this may be an adb or kernel issue. I have the same kernel and same ADB version as you (Actually running arch as well ^_^)

The odd thing is the udev rules work just fine in creating the initial links and the flakiness in the usb attachment doesn't start until after I spawn the adb server (I'm not sure if yours is the same way). The only difference between our behavior that I can see is that I'm using a Samsung S8+ :/ (sorry for the wrong thread and if this is hijacking please let me know and I'll delete it.). I am just trying to lend evidence to his/her issue.

udev version

root at locallaptop.local in ~
$ udevadm --version
235

kernel version

root at locallaptop.local in ~
$ uname -r
4.13.7-1-ARCH

adb version:

root at locallaptop.local in ~
$ adb --version
Android Debug Bridge version 1.0.39
Revision 8.0.0_r17

unplugging and then Plugging in my phone prior

Prior to starting the adb server:

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[6495.318173] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6495.318456] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6495.318563] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[6495.318717] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[6495.318851] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6495.320466] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6495.320719] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [6495.321900] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV [6495.322998] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV [6495.323727] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6495.324702] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV [6495.344709] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[6510.098862] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[6510.101484] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6510.102087] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[6510.102905] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6510.103484] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[6510.104179] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6510.677580] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [6510.680327] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [6510.682239] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV [6510.683855] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV [6510.684237] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6510.686602] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)

Now when I start ADB the device is repeatedly disconnected:

KERNEL[6600.187212] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[6600.190544] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6600.190930] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[6600.192065] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6600.192586] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[6600.194047] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6600.750663] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [6600.756551] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV [6600.756820] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [6600.758959] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV [6600.762960] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6600.763358] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6601.181364] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV [6601.186369] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6601.500084] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6601.500886] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6601.501316] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6601.501415] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[6601.501566] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[6601.501811] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
KERNEL[6601.502434] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [6601.504065] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [6601.504908] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV [6601.505005] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)
UDEV [6601.505985] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
UDEV [6601.506638] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
UDEV [6601.507346] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
UDEV [6601.524724] remove /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[6601.994357] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[6601.996190] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[6601.996697] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1 (usb)
KERNEL[6601.997695] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/tty/ttyACM0 (tty)
KERNEL[6601.998163] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.2 (usb)
KERNEL[6601.998534] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.3 (usb)

Corresponding kernel log:

Oct 27 16:43:45 locallaptop.local kernel: usb 1-1: new high-speed USB device number 47 using xhci_hcd
Oct 27 16:43:46 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:47 locallaptop.local kernel: usb 1-1: USB disconnect, device number 47
Oct 27 16:43:47 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:47 locallaptop.local kernel: usb 1-1: new high-speed USB device number 48 using xhci_hcd
Oct 27 16:43:47 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:49 locallaptop.local kernel: usb 1-1: USB disconnect, device number 48
Oct 27 16:43:49 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:49 locallaptop.local kernel: usb 1-1: new high-speed USB device number 49 using xhci_hcd
Oct 27 16:43:49 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:51 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Oct 27 16:43:51 locallaptop.local kernel: usb 1-1: USB disconnect, device number 49
Oct 27 16:43:51 locallaptop.local kernel: usb 1-1: new high-speed USB device number 50 using xhci_hcd
Oct 27 16:43:51 locallaptop.local kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device

Finally, trying to connect via libmtp works without issue for me:

$ mtp-detect
libmtp version: 1.1.14

Listing raw device(s)
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Found 1 device(s):
Samsung: Galaxy models (MTP) (04e8:6860) @ bus 1, dev 79

I tried clearing my "External Storage" and "Media Storage" which seems to fix the issue if you get:

LIBMTP_Get_Storage(): Resource temporarily unavailable

When trying to pull/push files via mtp but I'm not having that issue and can list/use mtp without issue:

$ timeout 1 mtp-filetree
Device 0 (VID=04e8 and PID=6860) is a Samsung Galaxy models (MTP).
Attempting to connect device(s)
Device: MyAndroidPhone
Storage: Phone
2000000 Samsung
2 Music
891 Over_the_Horizon.mp3
2000001 Android
4 data
2000022 .nomedia
2000023 com.samsung.android.coreapps
2000173 cache
2000174 volley
2000024 com.android.providers.media
2000175 albumthumbs
2000025 com.google.android.youtube
2000177 cache
2000179 exo

Is this the same with your phone as well?

EDIT:: After downloading the latest ADB client/server it works without issue::

$ ./adb devices -l
List of devices attached
98891a303554423541 device usb:3-1.1 product:dream2qltesq model:SM_G955U device:dream2qltesq