Posted on Thu 26 September 2019

Debugging Android devices with adb on Ubuntu

Just some notes for myself next time.

Either download the Platform Toolscache 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 notcache). 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 AskUbuntucache.

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.

Category: misc

Tags: programming, android, mobile

© Julian Schrittwieser. Built using Pelican. Theme by Giulio Fidente on github. .