我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
这些帮助了我:
1.启用ADB集成 2. 进入Android设备监视器 检查您的设备是否在线,并创建所需的过滤器
其他回答
执行->debug命令 如果你失去了与主机的连接,它会要求重新连接。单击yes。这样就行了。
在我的例子中,在开发人员选项菜单中有一个名为
撤销USB调试授权。
一旦你撤销所有现有的授权,它会再次要求信任你正在使用的计算机,之后它开始再次显示日志。
确保您已经在build variables上下文菜单中启用了构建变量以“调试”。(你可以在窗口的左下角找到它)。如果您之前已经为应用程序签署了apk,则此选项将被设置为发布模式。这将导致调试消息不显示在日志猫中。
这些帮助了我:
1.启用ADB集成 2. 进入Android设备监视器 检查您的设备是否在线,并创建所需的过滤器
我刚把它修好了。在DDMS显示的最右边寻找恢复Devices Logcat视图和ADB视图的小图标。
When the DDMS first came up with both the "ADB Logs" and the "Devices | logcat" tab showing. The "Devices | logcat" is the one that should be showing the device output, but was blank. Somehow I managed to hide one or the other of those tabs, I forget exactly how. But, off to the right there was a tiny icon that said "Restore ADB" view, and I clicked it and it came up. Then there was another tiny icon that said "Restore Devices logcat view". I clicked that, and all of a sudden it appeared and was showing the device output again.