I\'ve been developing an Android Application for Android
(SDK min version 14) and I have testing it normally with tablets such as Samsung Galaxy 2 and Nex
Recently, I was facing the same issue for Vivo and MI phones. I have tried everything described in this thread. I tried connecting as MTP, PTP; But nothing worked.
After many retries I found a solution for my case and may be it can help others too.
adb kill-server
adb start-server
It solved my issue.
On ubuntu installing adb worked for me, I think there was some problem with default android studio one .
In terminal use command
sudo apt install adb
Disabling and re-enabling debugging while the device was connected did the trick for me.
Have the same problem with my Nexus 5/5X/Pixel 2 XL on Ubuntu 18.04.
A permanent solution is to add a udev rule so that you can always access the device.
Find your device with the command lsusb
. This outputs e.g. for my Pixel 2 XL this:
Bus 001 Device 003: ID 18d1:4ee7 Google Inc.
# This means: BUS=001, DEVICE=003, VENDOR=18d1, PRODUCT=4ee7
Now check the permissions. Replace 001 and 003 with your parameters:
ls -l /dev/bus/usb/001/008
# Output: crw-rw-r-T 1 root root 189, 8 Nov 10 18:34 /dev/bus/usb/001/003
# Unless you are root, you are missing the permissions to access the device
To fix this, create a udev rule file with sudo nano /etc/udev/rules.d/51-android.rules
with the following content:
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee7", MODE="0660",
GROUP="plugdev", SYMLINK+="android%n"
# You need to replace "18d1" and "4ee7" with your output of `lsusb` above
Unplug and plug you device back in. It should now always be recognized.
If not, restart the adb server a last time with adb kill-server
.
Source: http://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/
First check adb version:If it gives Output like
Android Debug Bridge version 1.0.32
Then just restart the daemon.
sudo adb kill-server
sudo adb start-server
else install adb first and restart the daemon Worked for me, in ubuntu 16.04.3
Just run this command after you connect your device to your Ubuntu system:
adb devices
This works for me.
Note: Make sure you have selected file transfer option in your phone.