1

My device ran into a problem running my test project on my android device after downloading android studio.

How can I configure android studio 2.X to connect to my device through the adb port?

muru
  • 197,895
  • 55
  • 485
  • 740
Dendor
  • 21

1 Answers1

2
  1. Configure the device to connect as MTP.

  2. Enable USB debugging in your device's Developer options.

  3. In a terminal type lsusb. You will get a USB devices list where each line looks like this:

    Bus 002 Device 004: ID 17ef:1004 Lenovo Integrated Webcam
    

    Notice the number right after ID. In this case it's ID 17ef. This number is the device's Vendor number, in this case Lenovo.

  4. As root, create the file /etc/udev/rules.d/51-android.rules. Open it with a text editor like gedit for example and add this line:

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

    Of course you must replace 17ef with the vendor number of your device (list).

  5. Save the file and you're good to go. The first time Android Studio detects your device, it will send an SHA1 number to the device and you have to accept it for the connection to be made. You can save this number to the device and from that moment on, it will recognize your computer automatically and won't ask you for a permission again.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Stormlord
  • 6,317