Tuesday, January 3, 2017
Udev Rule for Android SDK
Udev Rule for Android SDK
Either because I have wanted to use adb commands, or actually use the Android SDK, I find that I not only need to install the SDK from: http://developer.android.com/index.html, but also I need to write a udev rule.
One sign that you need a udev rule is when you execute the command, adb devices, you see output something like:
List of devices attached
???????????? device
First, you need to attach the Android phone with the USB cord, and have the Settings, Applications, Development, USB debugging enabled on the phone. Next execute the command, lsusb. In my case, the line Im interested in shows my phone like this:
Bus 001 Device 005: ID 0bb4:0c9e High Tech Computer Corp.
Notice the hexadecimal digits that I have bolded from this line. They need to be modified to match the digits of the attached phone in a rule file such as /etc/udev/rules.d/51-android.rules:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c9e", MODE="0666" SYMLINK+="android_adb"
The location and name of this file is very important!
By the way, I found a great blog entry on how to write udev rules today:
http://howtoxyz.blogspot.com/2008/07/writing-udev-rules-other-way.html
One sign that you need a udev rule is when you execute the command, adb devices, you see output something like:
List of devices attached
???????????? device
First, you need to attach the Android phone with the USB cord, and have the Settings, Applications, Development, USB debugging enabled on the phone. Next execute the command, lsusb. In my case, the line Im interested in shows my phone like this:
Bus 001 Device 005: ID 0bb4:0c9e High Tech Computer Corp.
Notice the hexadecimal digits that I have bolded from this line. They need to be modified to match the digits of the attached phone in a rule file such as /etc/udev/rules.d/51-android.rules:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0c9e", MODE="0666" SYMLINK+="android_adb"
The location and name of this file is very important!
By the way, I found a great blog entry on how to write udev rules today:
http://howtoxyz.blogspot.com/2008/07/writing-udev-rules-other-way.html
Available link for download