Logcat cannot detect app or package names

2019-02-01 18:00发布

I'm using Android Studio (Beta) 0.8.7 and my logcat has been working fine for months. All of a sudden my logcat is unable to detect any app or package names. This means I cannot filter the messages for the particular app I'm testing which is very annoying. Typical logcat messages now look like this:

enter image description here

Notice the question mark (?) where the app/package name should be...

Originally I thought it was my device but I've tried it with another android device that I own and I get the same issue. This is what I've tried:

  • Restarting Android Studio and my computer
  • Killing and starting the ADB server from the terminal
  • Restarting the devices

Has anyone experienced this before? Help please as it is driving me a little crazy...

UPDATE: I tried my laptop which has android studio installed and it is doing the same thing! I'm about 95% sure that the app/package name should be there instead of the question mark because that's the way I remember it. Also with a question mark the logcat is unable to filter messages by the app's package name...I never had this problem in the past so it must have been working so I can't be going crazy...

9条回答
The star\"
2楼-- · 2019-02-01 18:21

This question helped me with my issue and I would like to add my humble addition about solving this problem when it appears again even with enabled ADB integration.

Simply start Android Studio before emulator. I'm using Genymotion(2.6.0) and used to start it before Android Studio(2.1.2) in my situation this bug was revealed.

查看更多
戒情不戒烟
3楼-- · 2019-02-01 18:22

I have the same problem with that.

Now I have solved by using the Debug Mode. After execution of the debug mode, you can run in normal mode forever. You'll see the application name in Logcat now.

查看更多
戒情不戒烟
4楼-- · 2019-02-01 18:24

Check in your "tools -> android" if you have the option enable ADB integration checked - that was my case, that for some reason the package name was not visible like in your case.

I think there might be some keyboard shortcut that is toggling the effect as I'm sure I did not change this myself, however manual checking the option and restarting emulation (just hit run) solved the problem.

查看更多
对你真心纯属浪费
5楼-- · 2019-02-01 18:24

This is what worked for me: My Tools / Android / Enable ADB Integration was already ticked, but package name was not on log cat. I unticked ADB Integration and again clicked to re-enable (tick) ADB Integration. Magically, the package name was there in log cat. Not sure if this works for all.

查看更多
forever°为你锁心
6楼-- · 2019-02-01 18:27

Same problem here with Android Studio 1.0 RC2. The Device Monitor shows the application name but in Android Studio's logcat panel, the package name is always a question mark.

I fixed the problem by Checking Tools / Android / Enable ADB Integration and then restarting adb.

A simpler way to is to Debug any app, if ADB integration is disabled, Android Studio will prompt you to enable.

You have to enable ADB integration to launch debugging. Do you want to do that?

Click Yes, of course.

查看更多
乱世女痞
7楼-- · 2019-02-01 18:31

An answer can be found here (#4)

It says: "Enable ADB Integration in: Tools / Android / Enable ADB Integration"

查看更多
登录 后发表回答