Android Logcat is empty when debug with device in android studio

后端 未结 11 1382
轻奢々
轻奢々 2020-12-08 14:21

When I try to debug using android device in android studio Logcat shows nothing. But when I use emulator LogCat shows all the messages. How should view the Logcat messages w

相关标签:
11条回答
  • 2020-12-08 14:37

    In Android Studio 2.x I used to have to restart to get it working but often switching back and forth between the applications works or running

    adb kill-server; 
    adb start-server;
    

    to restart adb fixes many things as well.

    0 讨论(0)
  • 2020-12-08 14:40

    The problem seems to have different causes.

    For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.

    0 讨论(0)
  • 2020-12-08 14:42

    In Android studio 1.* if logcat messages have disappeared for me helps the next trick:

    Tools -> Android -> disable )) "enable ADB integration" (if it've been enabled)
    Tools -> Android -> enable it again "enable ADB integration"
    
    0 讨论(0)
  • 2020-12-08 14:43

    In Android studio 1.0.2 or later: you should enable ADB integration through Tools -> Android, before run your app

    0 讨论(0)
  • 2020-12-08 14:45

    If anyone's still having trouble with this despite trying all the answers here, just use System.out.println instead of log.* and your debug messages will output.

    0 讨论(0)
  • 2020-12-08 14:46

    As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)

    0 讨论(0)
提交回复
热议问题