Debugging Android devices with adb on Ubuntu

Thu 26 September 2019

Just some notes for myself next time.

Either download the Platform Tools package or directly install adb from the repository:

sudo apt install adb

If you are running Ubuntu, make sure that you are in the plugdev group (sudo usermod -aG plugdev $LOGNAME if not). You may have to create a udev rule to ensure the device is mounted under the right group.

To do so, create a file /etc/udev/rules.d/51-android.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d002", MODE="0660",
GROUP="plugdev", SYMLINK+="android%n"

Where vendor and product id must match your device as listed by lsusb, as per AskUbuntu.

Finally, don't forget to enable developer mode and USB debugging on your phone and connect it to your computer over USB :)

That's it, adb shell should now connect to your phone.

Tags: programming, android, mobile


Loading comments...

© Julian Schrittwieser. Built using 開æŋ. Theme by Giulio Fidente on github. .