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?
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?
Configure the device to connect as MTP.
Enable USB debugging in your device's Developer options.
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.
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).
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.