我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
重新启动我正在测试的手机就解决了这个问题。
我用的是旧的LG4和Android 6。
我试着拔了又插,重新启动Android Studio,重新启动logcat,使缓存无效-什么都没有工作。
其他回答
Easy fix that worked for me (after trying some of these other suggestion). My logcat was sitting blank in a separate window (on my second screen). Just had to drag the Logcat tab back to it's original place in the debug panel next to the Debugger and Console tabs, and VOILA... it began immediately updating and showing all processes verbose. So (If your logcat is anywhere outside of the debugger panel (i.e. the logcat tab isn't sitting nested alongside the debugger and console tab) then it won't receive updates and will sit there blankly. Don't know if this is an issue with older versions of Android Studio. But again, easy to try and if it works... it works!!
步骤1:连接你的手机与Android开发者选项和USB调试。
步骤2:进入“查看>工具窗口> Logcat”
第三步:在运行项目之前,确保你的手机连接Android Studio。然后运行应用
注意:如果不能显示Logcat,请重新启动Android Studio: File > Invalid Caches/ Restart
在Android studio 0.8.0中,您应该在运行应用程序之前通过Tools -> Android启用ADB集成。然后日志猫将正常工作。请注意,如果您在应用程序运行时禁用ADB集成,然后再次启用它,那么日志猫不会显示任何东西,除非您重新构建项目。
在我的例子中,它通过TCP连接断开,即使设备出现了。
调用
adb connect <device ip>
重启logcat OK。
要运行Logcat,请重新启动Logcat,然后打开DDMS(要打开它,请单击Android DDMS右上角的Android图标)。设置“日志级别=调试”。然后运行你的应用。