Why can't I run adb via udev?
I've given a try to http://www.joescat.com/linux/android_rules.html
but it failed to start adb server, don't know why

In "/etc/udev/rules.d/51-android.rules":

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", ACTION=="add", RUN+="/usr/bin/rehtet"


/usr/bin/rehtet (nohup and &amp; and disown won't work, "at now" work):

#!/bin/bash
echo "/usr/bin/adb shell ls &gt;/tmp/rehadb.log" | at now


And the last 3 lines in the rehadb.log showed:

...
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
connect(3, {sa_family=AF_INET, sin_port=htons(5037), sin_addr=inet_addr("127.0.0.1")}, 16


Finally, I fixed it (maybe there are bad side effects):

edit "/lib/systemd/system/systemd-udevd.service", change "IPAddressDeny=any" into "IPAddressDeny="
run "systemctl daemon-reload"   "service udev restart"
to enable udev script (gnirehtet / adb) to access 127.0.0.1:5037