Android Studio 无法识别我的设备
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25199660/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio doesn't recognize my device
提问by Red Hot Chili Coder
Here is the problem. I want to run my Android Studio apps on my device (Samsung Galaxy Ace 2). But nothing works for me. Tell me what I've missed:
这是问题所在。我想在我的设备(三星 Galaxy Ace 2)上运行我的 Android Studio 应用程序。但没有什么对我有用。告诉我我错过了什么:
1) USB debugging is on
1)USB调试开启
2) ADB driver is installed (in device manager i can see Android Composite ADB Interface)
2) 安装了 ADB 驱动程序(在设备管理器中我可以看到 Android Composite ADB Interface)
3) ADB device list is still clear, even if i reset server(adb kill-server, adb start-server, adb devices - list of devices is clear)
3)ADB设备列表仍然清晰,即使我重置服务器(adb kill-server,adb start-server,adb devices - 设备列表清晰)
4) in google usb driver directory, in android_winusb.inf file I added my device identificators
4) 在 google usb 驱动程序目录中,在 android_winusb.inf 文件中我添加了我的设备标识符
5) Android device manager still cannot connect to my device, showing this error when I reset it: "adb connection error an existing connection was forcibly closed by the remote host"
5)Android设备管理器仍然无法连接到我的设备,当我重置它时显示此错误:“adb connection error an existing connection was forceed closed by the remote host”
So I will be glad to hear any advices. Hope you'll help me
所以我会很高兴听到任何建议。希望你能帮助我
采纳答案by Red Hot Chili Coder
I am sorry that i bothered you all. The problem was my device is cloned in different places in device manager. It was gone when I tried to update driver for my phone in "Other devices" list, and before i have been updating it in wrong sections. Thank you all.
很抱歉打扰了大家。问题是我的设备在设备管理器中的不同位置被克隆。当我尝试在“其他设备”列表中更新手机的驱动程序时,以及在错误的部分更新它之前,它就消失了。谢谢你们。
回答by FrankMonza
Did you try to configure the "Media Mode" in "Camera (PTP)" instead of "Media device (MTP)"? This is sometimes solving the issue. Its in the USB Computer Connection options of your Android device, you should see an "authorize" dialog then.
您是否尝试在“相机(PTP)”而不是“媒体设备(MTP)”中配置“媒体模式”?这有时可以解决问题。它在您的 Android 设备的 USB 计算机连接选项中,您应该会看到一个“授权”对话框。
Update 04/2017: looks like it has been fixed in Android 7.1.2
2017 年 4 月更新:看起来它已在 Android 7.1.2 中修复
回答by Nick Sarafa
Try swapping the USB port the cable is plugged into.
尝试更换电缆插入的 USB 端口。
Sounds crazy but after 20 minutes of debugging this worked for me.
听起来很疯狂,但经过 20 分钟的调试后,这对我有用。
回答by casillas
I have done numerous ways of handling that issue. Finally it has worked! I am using LG Optimus II
, but I believe the following steps are generic to other Android devices as well.
我已经做了很多处理这个问题的方法。终于成功了!我正在使用LG Optimus II
,但我相信以下步骤也适用于其他 Android 设备。
Step 1:
第1步:
Make sure your device is enabled for development. If yes, go to Step 2, otherwise go to Settings > About phone
and tap Build number
seven timeswhich is magic number :-).
Now Developer Options
is available in the Settings
.
确保您的设备已启用开发。如果是,请转到第 2 步,否则转到Settings > About phone
并点击Build number
七次这是幻数:-)。现在Developer Options
可以在Settings
.
Step 2:
第2步:
Before you plug your device to PC, Go to Settings > Developer Options
and select USB Connection method
.
在将设备插入 PC 之前,转到Settings > Developer Options
并选择USB Connection method
。
Step 3:
第 3 步:
Plug the phone to the PC, you are given options for the USB Connection method
, and please select Internet connection
. Make sure you have connected to the Internet. By the way, I have changed MTP
to PTP
, it did not work for me. Therefore, I tried Internet connection mode
, then it worked.
将手机连接到 PC,您会看到 选项USB Connection method
,请选择Internet connection
。确保您已连接到 Internet。顺便说一句,我已更改MTP
为PTP
,它对我不起作用。因此,我尝试了Internet connection mode
,然后它起作用了。
Step 4:
第四步:
Run the app in the Android Studio
, it will ask you to authorize the device for development, and select YES!.
在 中运行应用程序Android Studio
,它会要求您授权设备进行开发,然后选择YES!.
Step 5:
第 5 步:
Run the application via Android Studio
and choose the device, not emulator, and BINGO! Welcome to Android development board.
通过运行应用程序Android Studio
并选择设备,而不是模拟器和宾果游戏!欢迎来到安卓开发板。
回答by mgcaguioa
I also tried above solutions but got no luck. So here's what I did:
我也尝试了上述解决方案,但没有运气。所以这就是我所做的:
- Download and install PdaNet+to fix connection issues between my computer and android device
- Enable USB debugging on my android device
- Unplug the phone and plug it again after it's installed
- Run my app and voila! My android device is now recognized by Android Studio
- 下载并安装PdaNet+来修复我的电脑和安卓设备之间的连接问题
- 在我的 android 设备上启用 USB 调试
- 安装好后拔掉手机再插上
- 运行我的应用程序,瞧!我的 android 设备现在被 Android Studio 识别
回答by jimmyjudas
Although my computer could recognise my phone, I had to install the official drivers from the Samsung developer site to get adb/Android Studio to recognise it:
虽然我的电脑可以识别我的手机,但我必须从三星开发者网站安装官方驱动程序才能让 adb/Android Studio 识别它:
回答by Sukumar Nagarajan
Click Revoke USB debugging authorization in Developer option and try it again.
在开发者选项中点击撤销USB调试授权,然后重试。
回答by Ajay B
Solution for those working with Huawei phones - You will get this error when ADB interface is not installed. Check if you have installed Huawei HiSuite. USB driver gets installed when you install HiSuite (I suppose this is true for most of the new phones that come with a Sync Software). If the ADB interface is installed on your computer you should see 'Android Composite ADB Interface' under Android Phone in your Device Manager as shown in this picture.
使用华为手机的解决方案 - 未安装 ADB 接口时会出现此错误。检查您是否安装了华为HiSuite。安装 HiSuite 时会安装 USB 驱动程序(我想这适用于大多数带有同步软件的新手机)。如果您的计算机上安装了 ADB 接口,您应该会在设备管理器中的 Android 手机下看到“Android 复合 ADB 接口”,如下图所示。
回答by Prashant Arvind
回答by Keith Holliday
For me, I tried the above. Turns out my USB cable was bad. I changed the cable and then it worked.
对我来说,我尝试了上述方法。原来我的USB线坏了。我更换了电缆,然后它起作用了。
回答by harindersingh
I had the same problem. So here is what i did
我有同样的问题。所以这就是我所做的
- reinstalled the device driver
- changed the USB computer connectionfrom MTPto Mass storage(UMS)
- 重新安装了设备驱动程序
- 将USB 计算机连接从MTP更改为大容量存储 (UMS)
And it worked.
它奏效了。