Development Machine Setup¶
Additional udev rules for using adb¶
Note: On Ubuntu, the android-sdk-platform-tools-common apt package may contain the required udev rules (but as of 18.04, it doesn't). Other distros may have a similar package. The rules file below is based on the Ubuntu package.
If the output of running adb devices with a SOM plugged into your PC via USB-C looks like the following, you likely need an additional udev rules file:
$ adb devices List of devices attached 5cab7e77 no permissions (user in plugdev group; are your udev rules wrong?); see [http://developer.android.com/tools/device.html]
In particular, the output says I am in the plugdev group but still don't have permission.
Create the file /etc/udev/rules.d/51-qcom-android.rules1 with the following contents:
# Skip this section below if this device is not connected by USB
SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
# Devices listed here in android_usb_rules_{begin...end} are connected by USB
LABEL="android_usb_rules_begin"
# QCS6490
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="9135", ENV{adb_user}="yes"
# Enable device as a user device if found
ENV{adb_user}=="yes", MODE="0660", GROUP="plugdev", TAG+="uaccess"
LABEL="android_usb_rules_end"
The new rules will not immediately take effect:
- Unplugging/replugging the cable to the SOM should in theory work, but currently has issues SOM-side (#29258).
- You may be able to trigger them by running
udevadm triggeror restarting udev as in the instructions above (not tested). - Easiest: restart the SOM.
1 On Ubuntu 18.04, the rules file installed with the android-sdk-platform-tools-common package is named 51-android.rules (in /lib/udev/rules.d/). The new rules file you add cannot have the same name, or else the two files seem to clash and you may only get rules from one or the other.