user in plugdev group; are your udev rules wrong or error: insufficient permissions for device: udev requires plugdev group membership?

I encountered error like "(user in plugdev group; are your udev rules wrong?", After googled, I found some key refers:

  • Ref 1. Set up a device for development from Android Developer;
  • Ref 2. Solved: no permissions (user in plugdev group; are your udev rules wrong?): Solution 3;
  • Ref 3. Android udev rules list aimed to be the most comprehensive on the net;

It seems I should have fixed my error since I found Ref 2 as above; As Android Developer docs say:

Ubuntu Linux: Use apt-get install to install the adb package. This gives you a community-maintained default set of udev rules for all Android devices.

I was confused because I had env variable ANDROID_HOMEon 16.04LTS(my current use) and export two below which I DO NOT install adb with apt-get install adb.

# set android adb tools
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

I checked /etc/udev/rules.d/ which have 170-snap.core.rules 70-snap.vlc.rules. Was that(not install apt-get install adb) I missed this file /etc/udev/rules.d/51-android.rules? Answer is NO.

  1. Which adb package I should use on Ubuntu 16.04LTS, "~/Android/Sdk/platform-tools/adb" or "sudo apt-get adb"?

    As danzel(nice and humorous person below) and Andoroid developer docs suggest, I keep two export as mentioned above and sudo apt-get install adb for a community-maintained default set of udev rules for all Android devices.

  2. Should I add this 51-android.rules to /etc/udev/rules.d/ meanwhile I backup thoes two 70-snap.core.rules 70-snap.vlc.rules?
    1. They have no relationship.
    2. As Android developer docs(webpage language as Chinese or '中文-简体') say, developers create /etc/udev/rules.d/51-android.rules file as root or sudo command, use chmod a+r /etc/udev/rules.d/51-android.rules change privilege of this file. Add rule into this file, check Solution 3.
    3. Other files are NOT mentioned, so don't touch them.
  3. Will be caused unreversed errors for my developer computer env?

    I laughed myself just as danzel(nice and humorous person below) said "the inverse operation of creating a file is deleting it";

Latest updated: 2019-09-02


Solution 1:

Answer: you need create sudo /etc/udev/rules.d/51-android.rules file as root privilege, then use sudo chmod a+r /etc/udev/rules.d/51-android.rules change privilege of this file. Add rule into this file, check Solution 3 know how to make a rule.

Solution 2:

There are some specific things to do for Ubuntu to make USB debugging work, described in this page on developer.android.com about setting up a device for development.

What it suggests is to run these two commands in terminal:

sudo usermod -aG plugdev $LOGNAME
sudo apt-get install android-sdk-platform-tools-common

The above package contains a community-maintained set of udev rules for Android devices.

Rebooting may be needed for the changes to take effect.