无法将Android Studio的调试器附加到Android进程 [英] Can't attach Android Studio's debugger to Android process
问题描述
我无法将Android Studio的调试器附加到我的可调试应用程序进程。有人有这个问题吗?基本上我无法在选择流程
对话框中列出我的应用程序。
I can't attach Android Studio's debugger to my debuggable application process. Anyone else had this issue? Basically I can't get my app listed in Choose Process
dialog.
我选择将调试器附加到Android进程
:
那么,以下是来自Android Studio的进程选择
对话框的方式如下:
And then, here's how Process selection
dialog from Android Studio looks like:
任何想法为什么我的应用程序没有显示选择流程
列表?
Any ideas why my app is not shown in the Choose Process
list?
尽管 DDMS
我的应用程序在设备| logcat
列表:
Although, DDMS
sees my app in Devices | logcat
list:
Android监视器
也可以看到该应用在设备
列表:
Android Monitor
also sees the app in Devices
list:
我已经尝试了这些操作:
I've tried these actions:
- 重新启动
MacBook
- 重新启动设备:尝试使用
Samsung Galaxy Note II N7100
(4.3)和Samsung Galaxy S4
(4.4.2) - 重新启用
设置 - >设备上的开发人员选项
- 重新启用
设置 - >开发人员选项 - > USB调试
设备 - 通过运行
adb kill-server
和<$ c重新启动adb
$ c> adb start-server - 从macbook重新连接设备和/或插入另一个USB端口
- 启动Genymotion Macbook上的虚拟设备
-
在TCP模式端口重新启动:5555
通过运行adb tcpip 5555
然后连接到它与adb连接192.168.1.87
-
等待更多
&重新启动
当出现此错误说ADB没有响应。您可以等待更多,或手动杀死adb进程,然后单击重新启动。
ADB中的错误:
ddms: $ ANDROID_HOME / platform-tools / adb,start-server'failed - 必要时手动运行
错误屏幕截图
- Restarting
MacBook
- Restarting devices: tried with
Samsung Galaxy Note II N7100
(4.3) andSamsung Galaxy S4
(4.4.2) - Reenabling
Settings->Developer Options
on the devices - Reenabling
Settings->Developer Options->USB debugging
on the devices - Restarting
adb
by runningadb kill-server
andadb start-server
- Reconnecting device from macbook and/or plugging to another USB port
- Launching Genymotion virtual device on macbook
restarting in TCP mode port: 5555
by runningadb tcpip 5555
and then connecting to it withadb connect 192.168.1.87
Waiting more
&Restart
when got this error sayingADB not responding. You can wait more, or kill "adb" process manually and click 'Restart'
Errors in ADB:
ddms: '$ANDROID_HOME/platform-tools/adb,start-server' failed -- run manually if necessary
Error screenshot
更新:
我注意到,该设备在 Android DDMS中多次出现
- > 设备| logcat
清单。如果我从列表中选择第一个设备,它显示,有无可调试应用程序
,但我选择最后一个设备(屏幕截图中的第四个)我看到我的可调试应用程序。查看截图:第1页和第4页。虽然列表中只有1个设备,并显示可调试的设备和应用程序,但仍然没有出现在 Choose Process
对话框中。
What I've noticed is that device appears multiple times in the Android DDMS
->Devices | logcat
list. If I choose 1st device from the list, it shows, there's No debuggable applications
, but I select last device (4th in the screenshot) I see my debuggable application. See screenshots: 1st and 4th. Although, even there's only 1 device in the list and showing debuggable device and application, process still does not appear in the Choose Process
dialog.
推荐答案
所以我终于找到了它:
Checking 'Show all processes' checkbox!
但是在问题中看到,复选框在开头,所以有多个问题。
BUT as you see in the question, checkbox was on at the beginning, so there were multiple issues.
总而言之,这些还有待完成的其他操作:
To summarize, these are other actions to be done:
- 全部删除
adb
进程(使用ps -x | grep adb
和kill -9 [process id]
) -
终端
中的adb start-server - 重新连接设备
-
adb设备
(确保设备已成功连接) - 确保
Android DDMS
设备| logcat
显示您的应用和只列出一个设备。 - 检查
显示所有进程
复选框。 查看截图
- Kill all
adb
processes (useps -x | grep adb
andkill -9 [process id]
) adb start-server
in terminal- Reconnect device
adb devices
(to make sure device is connected successfully)- Make sure
Android DDMS
Devices | logcat
shows your app and only one device is listed. - Check
Show all processes
checkbox. See screenshot
这篇关于无法将Android Studio的调试器附加到Android进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!