I am unable connect my Android to Ubuntu.
On executing command lsusb
. It shows attached device.
Bus 002 Device 001: ID 1d6b:0003 Linux
First, try unplug then plug the device. Then check the the message log using dmesg instead lsusb, because it gives you more information about the idVendor and idProduct. Use the following command to show the last 10 message log:
dmesg | tail
Now, you can ge the idVendor and idProduct. It will be something like this:
[24936.555273] usb 1-2: USB disconnect, device number 9
[24939.022181] usb 1-2: new high-speed USB device number 10 using xhci_hcd
[24939.187152] usb 1-2: New USB device found, idVendor=04e8, idProduct=6860
[24939.187154] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[24939.187156] usb 1-2: Product: SAMSUNG_Android
[24939.187157] usb 1-2: Manufacturer: SAMSUNG
[24939.187158] usb 1-2: SerialNumber: 5ae1b464
[24939.188132] cdc_acm 1-2:1.1: ttyACM0: USB ACM device
add the following line to your /etc/udev/rules.d/51-android.rules (Beware, you need to change idVendor
, idProduct
and username
to yours):
SUBSYSTEM=="usb", ATTR{idVendor}=="2a70", ATTR{idProduct}=="9011", MODE="0600", OWNER="username"
You also can use the 51-android.rules file from android-udev-rules.
Here I'm copying the step for Ubuntu from its documentation:
# Clone this repository
git clone git@github.com:M0Rf30/android-udev-rules.git
# Create a sym-link to the rules file
sudo cp android-udev-rules/51-android.rules /etc/udev/rules.d/
# Change file permissions
sudo chmod a+r /etc/udev/rules.d/51-android.rules
# add the adbusers group if it's doesn't already exist
sudo groupadd adbusers
# Add your user to the adbusers group
sudo usermod -a -G adbusers $(whoami)
# Restart UDEV
sudo udevadm control --reload-rules
sudo service udev restart
# Restart the ADB server
adb kill-server
# Replug your Android device and verify that USB debugging is enabled in developer options
adb devices
# You should now see your device
Try to switch from MTP mode to PTP mode on your phone, it worked for me.
(got this tip from : https://android.stackexchange.com/questions/101933/samsung-galaxy-s4-does-not-show-authorize-usb-debugging-dialog-box)
You need to enable USB debugging on your phone.
This video demonstrates this from 0:33 to 1:03.
Copying the steps here:
- On your android device, go to
Settings
→System
→About phone
. Scroll down toBuild number
and continuously tap on it for a few times until a popup announcing Developer options to have been activated appears.- Go to
Settings
→Developer options
→Debugging
and activateUSB debugging
.
The device should now be listed under $ adb devices
once connected.
I had the same problem with an empty list of adb devices
. The only solution that worked for me was to take the first part of the device's ID(vendor id 0e8d
):
# lsusb
Bus 001 Device 055: ID 0e8d:201d MediaTek Inc.
Then edit, or create if it doesn’t exist the file ~/.android/adb_usb.ini and place on a single line the prefix 0x
followed by your vendor id:
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x0e8d
Then restart the adb:
adb kill-server
adb start-server;
adb devices