Android device is not connected to USB for debuggi

2019-01-10 12:32发布

I am trying to debug my application using a real device instead on the emulator. When I try to connect, it gives me the message:

USB device not found

I tried to unplug and plug it again, but it did not work. And I have also enabled USB debugging and unknown sources options in my device.

Any help is appreciated!

Thanks!

24条回答
姐就是有狂的资本
2楼-- · 2019-01-10 12:49

I had this problem with a Nexus 7 - it appeared in Device Manager fine but wasn't recognised by Android Studio. The device had USB debugging turned on. Eventually I noticed an icon in the top left hand corner that said "Connected as a media device. Touch for other USB options." When I selected this I was able to change from Media Device (MTP) to Camera (PTP) and then it started working.

查看更多
做自己的国王
3楼-- · 2019-01-10 12:49

I am using Samung S8, I tried to install:

  1. Intel Android Driver
  2. Samsung USB driver

But the adb bridge driver was still missing. I finally got it to work by installing the Samsung Smart Switch application which is a media manager application.

Updated at 2018-04-20: If you are struggle with the driver, just use http://adbdriver.com/downloads/

查看更多
做自己的国王
4楼-- · 2019-01-10 12:50

Check installed drivers. If drivers ok, check device usb-port it could be damaged.

查看更多
Root(大扎)
5楼-- · 2019-01-10 12:51

How to get connection to device working using adb command line:

USB debugging enabled on phone and phone connected.

I am exercising these commands on linux(redhat and ubuntu) but same commands work under the hood on windows. The device manager runs adb commands. You can find a console in your device manager or regular command-line works if you set up your paths to SDK.

If you can run adb and see something like ???????? in devices list ..

$ android-studio/sdk/platform-tools/adb devices
List of devices attached 
????????????    no permissions

You might be running the adb server as a regular user. You might have to run the adb server as root. So kill the server as regular user and start it as root.

$ adb kill-server
$ which adb
$ sudo <fullpath>/android-studio/sdk/platform-tools/adb start-server

Now look at adb devices list, if it is first time this machine connects to this phone you will see "unauthorized".

$ adb devices
List of devices attached 
MWS0216A31xxxxxx    unauthorized

At this point on phone you should have dialog popped up and you can tap ok to authorize. Then you should see "device" in the devices list and commands like shell/push/pull/sync/backup... should work.

$ adb devices
List of devices attached 
MWS0216A31xxxxxx    device

$ adb shell "uname -a; df; ls /storage/sdcard0/Download"
Linux localhost 3.10.90-g2ff1b22 #1 SMP PREEMPT Tue Dec 27 17:12:50 CST 2016 aarch64
Filesystem               Size     Used     Free   Blksize
/dev                     1.3G   108.0K     1.3G   4096
/sys/fs/cgroup           1.3G    12.0K     1.3G   4096
/mnt                     1.3G     0.0K     1.3G   4096
/sys/fs/cgroup/pids: Permission denied
/system                  2.4G     2.3G   106.8M   4096
/cust                  492.0M   327.7M   164.3M   4096
/cache                 248.0M   160.0K   247.8M   4096
/splash2: Permission denied
/3rdmodem               59.0M     4.9M    54.1M   1024
/3rdmodemnvm: Permission denied
. .
/storage                 1.3G     0.0K     1.3G   4096
/data                   25.1G    10.9G    14.2G   4096
/mnt/runtime/default/emulated: Permission denied
/storage/emulated       25.1G    11.2G    13.8G   4096
/mnt/runtime/read/emulated: Permission denied
/mnt/runtime/write/emulated: Permission denied
.
.

Lovely jubly. Hopefully.

查看更多
神经病院院长
6楼-- · 2019-01-10 12:52

Restart Android Studio Worked in my case

查看更多
该账号已被封号
7楼-- · 2019-01-10 13:01

I had the same problem with a Samsung galaxy note 2. It was recognized on one pc but not on another one (both running windows 7 64b). After hours of struggling, I installed Kies (from the Samsung website) on the pc where Android Studio was unable to detect the smartphone (Kies was installed on the other one).

Like magic, Android Studio detected the phone !!! I noticed that the Kies installer installed some driver for the phone.

Consequently, for those meeting the same detection problem, I would strongly advise to first install Kies.

查看更多
登录 后发表回答