UPDATE: Updated with data on using the hikey960
A lot of times in my hurry to get moving on a system I have a tendency to just simply say sudo adb and move on to solving my bigger problems. It works but sometimes it is better to get organized so that we do not have problems instead.
Take the time to fix the rules files for usb devices to properly recognize your devices, so that when a new USB device (read android device) is plugged in you have the necessary permissions.
You need to add the following lines…
# fastboot protocol on dragonboard (Qualcomm SnapDragon)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d00d", MODE="0666", OWNER="samyeer"
# adb protocol on dragonboard (Qualcomm SnapDragon)
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", ATTR{idProduct}=="9091", MODE="0666", OWNER="samyeer"
in…
/etc/udev/rules.d/51-android.rules
Remember you can only edit the file as superuser, and dont forget to replace my username with your’s.
sudo service udev restart
One thing to remember…this will save you a lot of pain. After making the changes, dont forget to remove and re-plug your device. You dont want to spend a lot of time thinking about why this is not working.
UPDATE: I recently started using he hikey960 board. What is cool about this board is that it is supported by Google. Which means that I am able to build the latest android release and test my stuff. I had to add an entry…
# adb protocol on hikey960
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0666", OWNER="samyeer"
The real way to do this is below. Since I am the only user on my system the one’s above works for me.
Configuring USB for ADB
The link below gives instructions to configure USB access. This assumes that you have sudo access, and will ask you to enter the password to be able to make changes to the required udev. and if you are like me and hate reading stuff..use the command line below.
$ wget -S -O - http://source.android.com/source/51-android.rules | sed "s/<username>/$USER/" | sudo tee >/dev/null /etc/udev/rules.d/51-android.rules; sudo udevadm control --reload-rules
https://source.android.com/source/initializing.html#configuring-usb-access
Configuring USB for FastBoot
To do the same with fastboot.
sudo sh -c "echo '# DragonBoard 410C' >> /etc/udev/rules.d/51-android.rules" sudo sh -c "echo 'SUBSYSTEM==\"usb\", ATTR{idVendor}==\"18d1\", MODE=\"0666\", GROUP=\"plugdev\"' >> /etc/udev/rules.d/51-android.rules" sudo service udev restart
http://stackoverflow.com/questions/27017453/fastboot-and-adb-not-working-with-sudo/28127944#28127944