How to make Debian detect your Android device so that you are able to run applications on a real Android device from Android Studio?

On your Android device

Enable developer options and USB debugging:

  1. Go to Settings > About phone
  2. Tap “Build number” seven times
  3. Go to Settings > System > Developer options
  4. Enable USB debugging

On your computer

As a root, add a regular user to the plugdev group (replace jari with your username).

usermod -aG plugdev jari

Remember to logout/login so the new groups will take effect.

Connect your Android device to your computer using USB cable and then use dmesg to find out the product ID of the connected device:

dmesg | grep idProduct | tail -1

The output should be something like this:

New USB device found, idVendor=2a70, idProduct=4ee7, bcdDevice= 4.09

Create an udev rules file at /etc/udev/rules.d/51-android.rules:

SUBSYSTEM=="usb", ATTR{idProduct}=="4ee7", MODE="0660", GROUP="plugdev", SYMLINK+="android%n"

Replace the 4ee7 with the product ID of your device.

Disconnect/connect your device for new rules to take effect.

Then run:

adb devices

Your device should ask permission to allow USB debugging. Answer OK. Now you should be able to access the device from your computer and install APKs to it from Android Studio.