A couple of days ago I was connecting a Android Things (NXP i.MX7D) to my Ubuntu 18.04 computer, but each time I tried to run a sample app in Android Studio I got the following error:
insufficient permissions for device: user in plugdev group; are your udev rules wrong?
So after some Googling I found out that I didn’t have enough privileges to access the Android Things device, simply put it was in
the wrong group.
So first i needed to add the path of the Android SDK and tools to my bashrc, well in my case to ~/.zshrc since I use Oh My ZSH. So first let’s add this two lines to the file:
So now we can use adb with no problem, In case you haven’t install Android Studio you need to install it first then add the path to bashrc or zshrc. Adb its not need to solve the problem but it’s very handy when you are developing a Android aplication.
Now we need to find the usb device so lets execute
lsusb in the terminal
You will get something similar. In this case we are looking fo a Google manufactured device. Les check the permissions of this device.
So yeah it’s in the group root wich its causing the problem. We will need to add a rule for the device so its assigned to a group I can access. So let’s create the rule
The idVendor and idProduct came from
Now we need to reconnect the device and we are ready to make a deploy.