Created
July 19, 2018 16:03
-
-
Save ktnr74/f749a4bc2aa13b190b46a8643d1b465d to your computer and use it in GitHub Desktop.
Universal udev rules file to set Android device permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do not forget to run 'sudo udevadm control --reload-rules' after editing this file | |
ACTION!="add", GOTO="android_usb_rules_end" | |
SUBSYSTEM!="usb", GOTO="android_usb_rules_end" | |
ENV{DEVTYPE}!="usb_device", GOTO="android_usb_rules_end" | |
ENV{ID_SERIAL_SHORT}=="", GOTO="android_empty_serial" | |
ENV{ID_SERIAL_SHORT}=="0000:*", GOTO="android_empty_serial" | |
ENV{ID_SERIAL_SHORT}=="0123456789ABCDEF", GOTO="android_empty_serial" | |
ENV{ID_USB_INTERFACES}=="*ff4201*", SYMLINK+="adb/$env{ID_SERIAL_SHORT}", TAG+="android" | |
ENV{ID_USB_INTERFACES}=="*ff4203*", SYMLINK+="fastboot/$env{ID_SERIAL_SHORT}", TAG+="android" | |
GOTO="android_usb_rules_end" | |
LABEL="android_empty_serial" | |
ENV{ID_USB_INTERFACES}=="*ff4201*", SYMLINK+="adb/usb:%k", TAG+="android" | |
ENV{ID_USB_INTERFACES}=="*ff4203*", SYMLINK+="fastboot/usb:%k", TAG+="android" | |
LABEL="android_usb_rules_end" | |
# use your preferred way to set device permissions here | |
TAG=="android", MODE="0666" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment