无法在Android设备上调试应用-Android Studio 2.0 [英] Not able to debug app on android device - Android Studio 2.0

查看:134
本文介绍了无法在Android设备上调试应用-Android Studio 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将android studio更新为2.0后,无法在我的设备(Asus Zenphone 2)上调试应用程序.在Android Studio中单击调试图标后,我一直在调试选项卡中看到以下消息.

I am not able to debug an app on my device (Asus Zenphone 2) after I updated android studio to 2.0. I keep seeing below message in debug tab right after I click on debug icon in Android studio.

Android Studio用户界面中调试"标签中的消息

Message in debug tab in Android Studio UI

---------------------------------------------------------------
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename

我一直看到标题为等待调试器"和强制关闭"按钮的警告"对话框.

I keep seeing Alert Dialog with the title "Waiting for Debugger" and Force close button all the time.

我搜索了该邮件,但似乎只有两个来自Google的结果.

I searched but it seems only two results from google for that message.

我重新启动了Android Studio,在手机上检查了开发者设置...

I restarted Android studio, checked developer settings on phone...

有人遇到这个问题.请帮我.我无法运行模拟器,因为我的Mac将太滞后.预先谢谢你.

Have anyone faced with this issue. Please help me. I cannot run the emulator, because my mac will be too lag. Thank you in advance.

推荐答案

问题是,在安装并开始启动应用程序之后,AndroidStudio启动的调试器客户端无法连接到调试器设备上的服务器. 这可能有很多原因,请查看此答案以及此页面上显示的其他答案,并查看其中一个是否为您解决了问题

The problem is that after installing and starting to launch the app, that debugger client that AndroidStudio starts is unable to connect to the debugger server on the device. This can have many causes, see this answer and the other answer shown on this page and see if one solves the problem for you

为帮助解决问题,请查看AS中调试器"窗口中的控制台"选项卡.前几行之一应如下所示:

To help figure out the problem, look at the 'Console' tab of the 'Debugger' window in AS. One of the first few lines should look like this:

$ adb shell是start -n"com.acme.audtest/com.acme.AudTest" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D

$ adb shell am start -n "com.acme.audtest/com.acme.AudTest" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D

将该行剪切并粘贴到命令提示符中,然后删除"-D"并执行它. 如果您的应用程序('AudTest')正常启动,则问题出在AS中,与设备的通信或设备的配置.如果应用程序无法启动,则位于.apk中. (不是完整的解决方案,而是开始为您指明正确的方向-以下哪种解决方案适用于您的情况.)

Cut and paste that line into a command prompt, REMOVE THE '-D', and execute it. It your app ('AudTest') comes up without error, the problem is in AS, is communication to the device, or the configuration of the device. If the app doesn't start, it is in the .apk. (Not the complete solution, but starts to point you in the right direction -- for which of the solutions below applies to your situation.)

首先,我选择第二个选项,并且效果很好.但是然后不知道为什么我更改为选择第一个选项.因此,调试器将永远显示消息Waiting for application to come online.而且我没有注意到,只是以为另一个应用程序阻止了我的调试,或者这是Android Studio 2.0的问题.

First I select the second option, and it worked fine. But then don't know why I change to select first option. So, the debugger shows the message Waiting for application to come online forever. And I did not notice that, just thought another app prevent me debug or that was an issue with Android Studio 2.0.

因此,只需选中第二个选项即可解决我的问题.谢谢大家.

So, just check to second option will solve my issue. Thank all.

这篇关于无法在Android设备上调试应用-Android Studio 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆