Make CentOS runlevel 3 to recognize adb device via udev

This was a tricky one. I needed some files from my home server which has run level 3 (Full multi-user text mode). It means no Graphical User Interface is present, everything happens from the command line. It’s a server after all. So, installed adb from the command line, that’s an easy one, with wget and android update sdk --no-ui.

So, adb like a pro, but notice first thing you have List of devices attached with no permissions. Can’t use adb shell or push files with adb push, or anything for that matter, because Android can’t allow the host computer to access without permissions and permissions cannot be allowed because there’s no GUI to notice when USB is connecting.

What you need to do is to log in to your Linux server CLI and run as root tail -f /var/log/messages, reconnect the Android phone to USB, take the “idVendor” from a line like:

kernel: usb 1-2: New USB device found, idVendor=XXXX, idProduct=XXXX

Then edit /etc/udev/rules.d/51-android.rules (new file) and add line:

SUBSYSTEM=="usb", ATTR{idVendor}=="YOUR_FOUR_LETTER_ID_HERE", MODE="0666", GROUP="plugdev"

Then just reboot or if you don’t want to lose uptime run udevadm control --reload-rules, then reconnect USB and voilà, there’s prompt in your phone!

Always beating challenges and learning new.

Want to write with me?

Do you know something about tech, nerdy stuff, movies, code, AI, Internet phenomena, social media or anything related to geeky subjects? Join and write with me! I'm currently doing this alone and my time is not sufficient for upkeeping the blog by myself, so all pieces of articles are welcome. Contact me and get your user account.

Roni Laukkarinen

Roni Laukkarinen

Editor-in-chief and owner of Geeky Lifestyle blog. Truly a jack of all trades, a Swiss knife; an avid tech and multimedia geek, coder, owner of a digital agency company, sysadmin, music enthusiast, artist and film critic.

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow The Geek

Geeky Lifestyle is a huge tweeter! Follow @thatgeekyblog to get real-time updates about what's happening in the scene.