You can check the adbd process or the init.svc.adbd request init.svc.adbd system property:
$ ps adbd USER PID PPID VSIZE RSS WCHAN PC NAME root 14947 1 4596 208 ffffffff 00019358 S /sbin/adbd $ getprop init.svc.adbd running
In Android, the adb driver is implemented as a function of the universal usb driver. You can check the usb enabled list of functions at the moment to see if it includes "adb" :
$ cat /sys/devices/virtual/android_usb/android0/functions mtp,adb
But you can’t stop cheating while your application is fully running on a user-controlled device.
source share