我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
我昨天安装了Android Studio,我试着用LogCat查看日志。但是日志里什么都没有。我使用终端运行。/adb logcat,它工作。
有人能给我解释一下如何在Android Studio中使用logcat吗?
当前回答
我检查了答案,只是在检查我的日志时偶然发现我的错误。 确保右边的方框显示“只显示选定的应用程序”。我的显示的是“Firebase”,所以它显示了来自Firebase的消息。
其他回答
在“设备logcat”选项卡的右侧有一个按钮“只显示所选进程的logcat”。它并不完美,因为每次我运行另一个进程时,我都需要再次推动它,但这是唯一适合我的解决方案。到目前为止…
在android Studio应用程序中,您需要单击调试应用程序选项(Shift+f9)以调试模式运行并启用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!!
确保您导入了正确的类
import android.util.Log;
这些帮助了我:
1.启用ADB集成 2. 进入Android设备监视器 检查您的设备是否在线,并创建所需的过滤器