Android Studio没有看到设备

当Android Studio的AVD管理器不显示物理设备,但`adb devices`命令可以时,可能需要检查设备驱动、切换USB模式或重启adb。在Android Studio中更改运行配置以选择目标设备,或者确保设备处于PTP模式并授权访问。有时,解决办法是退出并重新启动Android Studio。
摘要由CSDN通过智能技术生成

本文翻译自:Android Studio doesn't see device

The AVD manager in Android Studio doesn't show my device but "adb devices" does show it. Android Studio中的AVD管理器不显示我的设备,但“adb devices”确实显示了它。 Am I missing something obvious here? 我错过了一些明显的东西吗?


#1楼

参考:https://stackoom.com/question/17dbZ/Android-Studio没有看到设备


#2楼

The AVD Manager is for emulator images. AVD Manager用于模拟器映像。 It never shows hardware. 它从不显示硬件。 This is true for any usage of the AVD Manager: Eclipse, Android Studio, etc. 对于AVD Manager的任何使用都是如此:Eclipse,Android Studio等。


#3楼

To change what your application defaults to when you click run or debug in Android Studio, follow these steps: 要在Android Studio中单击运行或调试时更改应用程序默认设置,请按照下列步骤操作:

1. go to Run 1.跑步

2. Click on Edit Configurations 2.单击“ 编辑配置”

3. Select the project 3.选择项目

4. find the Target Device section under the General tab on the Android Application page . 4.Android应用程序页面的“ 常规”选项卡下找到“ 目标设备”部分。

That seems to be where you toggle what the project builds to. 这似乎是您切换项目构建的内容的地方。 If you're importing a project it actually defaults to Emulator, not sure why. 如果您正在导入项目,它实际上默认为模拟器,不知道为什么。 You can also select "Open Select Deployment Target Dialog" to list both connected as well as emulated devices. 您还可以选择“打开选择部署目标对话框”以列出已连接和已模拟的设备。


#4楼

检查设备驱动程序如果您的设备是Galaxy安装,Kise将搜索您的驱动程序


#5楼

I had to killall adb because somehow, Android Studio managed to crash and did not want to communicate with adb anymore. 我不得不使用killall adb因为不知怎的,Android Studio设法崩溃了,不想再与adb通信了。 Thus, my device did not show up. 因此,我的设备没有出现。

So quitting Android Studio, terminating all adb instances in Terminal and starting Android Studio again (should ask if it should enable debugging then) worked. 因此,退出Android Studio,终止终端中的所有adb实例并再次启动Android Studio(应该询问它是否应该启用调试)。


#6楼

I recently had trouble with this, and regardless of what I did(restart adb, edit adb_usb.ini, restart computer+device+swap usb port, reinstall studio etc. etc.) I just couldnt get it to work, and could not even detect my device using 'adb devices'. 我最近遇到了麻烦,无论我做了什么(重启adb,编辑adb_usb.ini,重新启动计算机+设备+交换USB端口,重新安装工作室等等)我只是无法让它工作,甚至无法工作使用'adb devices'检测我的设备。 Finally after about 2 hours of googling and testing, someone suggested switching to PTP instead of MTP on my device. 最后,经过大约2小时的谷歌搜索和测试,有人建议在我的设备上切换到PTP而不是MTP When I did this I got a popup on my device asking me to allow my mac access and suddenly everything worked(had to restart studio for it to show up there as well though). 当我这样做时,我的设备上有一个弹出窗口,要求我允许我的mac访问,突然一切正常(不得不重新启动工作室,以便它也显示在那里)。

I might be bumping this thread now, but it is the first result on google search, and I had a lot of trouble finding an answer for this problem, so I thought this should be added as a solution. 我现在可能会碰到这个帖子,但这是谷歌搜索的第一个结果,我在寻找这个问题的答案时遇到了很多麻烦,所以我认为这应该作为解决方案添加。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值