Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Android Logcat Package Feedback

Discussion in 'Android' started by Tomas1856, Dec 8, 2018.

  1. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Since one latest update something changed: On 1.2.1 every time we make any build on any different platform (Xbox/Playstation/Switch etc.) android logcat will popup an empty window, which is really annoying.

    Where/how can we turn this off, without having to remove the package?
     
    Last edited: Mar 31, 2021
  2. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    Top left corner of that window should have 'Auto run' as a button toggle for that
     
  3. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    That's certainly a bug, but yes you can disable this with AutoRun toggle
     
  4. vonSchlank

    vonSchlank

    Joined:
    Jan 5, 2017
    Posts:
    36
    How can i change font size and color? It's quiet unreadable. :-/
     
  5. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Preferences->Android Logcat Settings
     
  6. vonSchlank

    vonSchlank

    Joined:
    Jan 5, 2017
    Posts:
    36
    Thank you!
     
  7. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    This doens't work: The AutoRun setting isn't saved to a file we can commit to version control. And while on iOS or any other platform, the AutoRun toggle is not accesible because the logcat window only shows that you need to be on Android...
     
  8. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    In 1.2.1 version, it shows on any active platform. But either way, in 1.2.2 even with Auto Run On, the logcat won't appear if active platform is not Android
     
  9. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Hi Everyone,

    I'm just wondering if it's possible to parse logcat at runtime with this package?.

    Sometime I'm playing dev builds away from the dev setup, so being able to view the logs in-game would make things a whole lot easier. I'm loath to install a logcat app as these require root access.

    If not, is this something that could be (or is) under consideration please?

    That said, ideally I would like to read the logs on all platforms (Windows, Android & iOS) and I have been looking into the likes of NLog. But having a cross platform solution that uses the native logs is preferable.
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    I don't think this will be ever possible, at least with this package, since this is Editor only package, while you're talking about expanding the runtime part.

    There was actually an idea to have a shared iOS/Android solution in regards to logs, but iOS doesn't provide the flexibility as Android provides, so it never happened. The item to have iOS logs is still on internal roadmap, but it's very low priority, not even talking about Windows :)

    Hope that helps a bit.
     
    ROBYER1 and PeachyPixels like this.
  11. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Hi Tomas,

    Thanks for the reply. Yes it did help, good to know where things stand.

    Tbh I just came across a fantastic cross platform debugging solution on the Asset Store. Even better is that it piggy backs off the standard logging on each platform. So zero code changes and a nice in-app console & stats screen etc.

    I still think a cross platform solution in Unity would be a good idea though, even if just to read the logs at runtime.
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Could you share which solution is this? Curious about it.

    P.S I am not sure if you're aware but from Unity's Console Window you can connect to running player for any platform (similar like profiler), and that will show you logs, but those logs are limited to the ones done via Unity API like Debug.Log.
     
  13. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Of course, it's...

    https://assetstore.unity.com/packages/tools/gui/srdebugger-console-tools-on-device-27688

    In all fairness, I haven't tested it on Android or iOS yet (so might be overselling) but it works very well on Windows. Interested to hear your thoughts on it, although feeling like I've hijacked this thread now. Sorry! :rolleyes:

    Thanks, yes was aware. But I often find myself testing a sideloaded version of the game (away from a dev environment) and might encounter something that requires investigation there and then.
     
    Tomas1856 likes this.
  14. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Looks like a great package, very polished, but if I understand correctly it limits itself to logs done via Debug.Log*, I might be wrong. That means if you do logging via Java on Android or ObjectiveC via iOS, it won't be displayed. Also wondering, what's the behavior during the app crash, probably you wouldn't get any logs then. Those are only guesses though.
     
    PeachyPixels and ROBYER1 like this.
  15. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    I'm using IL2PP for all platforms, so my assumption (and I could very well be wrong here!) was that it should work consistently across all three.

    Will be testing on the iOS & Android builds in the coming days, so will report back if it helps.
     
  16. ARunitystudi

    ARunitystudi

    Joined:
    Apr 25, 2021
    Posts:
    21
    Hello! Is there a possibility to search for messages in the Android Logcat window?
    There is a search field on the top that is also activated by typing Ctrl + F, but it never finds anything I am typing there, although my input-text is available in the messages shown.

    Is it somehow possible to save the logs automatically to a file, when the application is closed?
    Currently, I save them by the options "Select All" and "Save Selection...", but it would be more comfortable if they can be saved automatically to a specified folder.
    Thanks.
     
  17. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Search is case sensitive, also check if you have Regular Expressions disabled.

    Which application - Unity Editor or Android Application? I assume Android Application, currently it's not really technically possible, but I'll see what we can do.
     
  18. ARunitystudi

    ARunitystudi

    Joined:
    Apr 25, 2021
    Posts:
    21
    Thank you, this was the problem. After I activated the Regex button, the search works.

    Yes, it is an Android Application.
     
  19. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    upload_2021-6-27_6-28-37.png

    I wrote something bad in the regex - and now I can't remove it.
    I tried reinstalling via package manager but my bad regex persists.
    Where is the preference file that contains my regex so I can delete it - it can't be deleted via the UI :( I am on a mac.
     
    Last edited: Jun 26, 2021
  20. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    Found it:
    upload_2021-6-27_6-45-12.png
     
  21. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    upload_2021-6-27_6-56-43.png

    In this screenshot - how come lines two and three are showing and how can I filter them out?
    I only want to see my Debug.Logs which start with IAP, and not all the UnityEngine Logs - is that possible?
     
  22. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Since the Priority (Info) and Tag (Unity) matches, the only way to filter them - is by message. Assuming IAP messages start with IAP, you could enter IAP in search field.
     
  23. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    Thanks, I have the regex ^IAP in the search field. I think the extra lines that show are the stack trace of the line that matches the regex - but I don't want to see them.
     
  24. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    In Player Settings, check stackrace logging settings, i think you can disable stackraces, but that will affect all messages
     
    korimako likes this.
  25. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    YES!!! Thank you, I never noticed that!
     
  26. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    Can you increase the brightness (contrast) on the red error text? I have a cheap 1080p 27" LCD monitor and the red error text is nearly unreadable against the dark background. Screenshots don't show this (it looks OK on other monitors) so I took a photo with my camera:
    IMG_4443.jpg
     
  27. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    You can choose the color yourself in Preferences->Android Logcat
     
  28. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    OK, yes. And that's awesome! o_O

    I didn't even know that existed. I knew about the options in Project Settings, but not Unity Preferences. Can I make a suggestion that you add a link to those Preferences from the Android Logcat Tools menu?
     
    Tomas1856 likes this.
  29. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    I submitted a bug about this (Case 1367221) but there seems to be a constant CPU spike and editor log spam (once per second) whenever the Android Logcat window is open. It causes notable frame rate hitches when playing your game. When the Logcat window is closed, the spike and spam goes away.

    [Logcat] [WorkThread] 14:19:08.5142 /Applications/Unity/Hub/Editor/2020.3.18f1/PlaybackEngines/AndroidPlayer/SDK/platform-tools/adb devices
    [Logcat] [WorkThread] 14:19:08.9251 List of devices attached


    The 270+ms CPU spikes:
    Screen Shot 2021-09-20 at 2.18.55 PM.png
     
  30. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    adb devices is called from a worked thread, it shouldn't cause a spike, thanks for the bug report, we'll try to investigate.
     
  31. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    Thanks, let us know what you discover or if you need more help reproducing it.
     
  32. Shikshen

    Shikshen

    Joined:
    Feb 21, 2015
    Posts:
    25
    There seems to be a bug on my 4K monitor on Windows, where the Logcat window sometimes stops auto-scrolling to the latest entry which is very annoying. This happens after scrolling manually and scrolling all the way back down again (which when it works, resumes the auto-scrolling behavior).

    I've noticed that it happens only on some specific window heights. For example if I resize the window by just one pixel it may start working again, then one more and it stops working.

    My guess would be that it's a rounding issue. The auto-scrolling behavior is activated only when the window is scrolled to the absolute bottom, but with my Windows Display scaling set to 175% (in the Windows System settings) it probably creates a rounding error such as the window is 501px high but because of the scaling it can't go above 500.5px, something rounds it down to 500px and the auto-scrolling never starts because it's one pixel off the absolute bottom?
     
    Last edited: Oct 27, 2021
  33. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    I'll log a bug, I think I've seen this too couple of times. Cheers
     
    fherbst likes this.
  34. mm_hohu

    mm_hohu

    Joined:
    Jun 4, 2021
    Posts:
    41
    @Tomas1856

    The search of Logcat does not work in Unity version 2021.2. It seems to delete the current buffer as soon as I enter a character in the search window, so nothing appears in the search results.

    After that, even if I delete the search string, all previous logs are not restored(I haven't cleared any of my logs).

    Another problem is that all logs seem to be erased when a domain reload occurs.

    Can you try to see if Logcat's search works on Unity 2021.2.01f in Windows environment?
    (Winsows10, Radeon RX570, Unity2021.2.0f1, Android Device=Redmi Note 9s, Android Logcat 1.2.3)
     
  35. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    Search is done via adb logcat, meaning it's not logcat package which does the searching, but it's the underlying adb logcat command, so in theory if you have a small buffer for logcat set on the device, or you have a huge amount of messages incoming, your messages might be discarded on the Android device.

    We have a task to move the search on the logcat package instead of giving to adb logcat, but it will probably take a while
     
  36. mm_hohu

    mm_hohu

    Joined:
    Jun 4, 2021
    Posts:
    41
    Thanks for your reply. I changed the log buffer of the device from 256kb->16MB and it worked fine.
    Thanks.
     
    Tomas1856 likes this.
  37. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    1.3.2 version is out now.

    1.3.2
    Fixes & Improvements

    • Fix integration tests not able to run on a specific build server configuration like Katana.
    • Fix stacktrace resolving, when Unity uses NDK 23.

    1.3.1
    Fixes & Improvements.

    • Docs updated.
    1.3.0
    Fixes & Improvements.

    • You can now perform text filtering when disconnected from the device, the filtering will be performed by the logcat package, previously it was performed by adb logcat command.
    • Text filtering has an option to ignore character casing.
    • Whenever entering new text filter selection of messages will persist, the selection will reset if adb logcat command is reexecuted, for ex., picking new tag, picking new priority, etc.
    • There are new settings in Preferences->Android Logcat Settings:
      • Max Cached Messages - controls how many unfiltered messages to keep in cache, you can remove the limit, and have as many messages as your memory let's you.
      • Max Displayed Messages - controls how many messages display on the list, you can remove the limit, but it might cause UI issues.
    • Fixed tiny issue, when right clicking on the log message, the tag and process id for context menu was being taken from the first selected item, now it will be taken from item which you're hovering on
    • Fixed issue, when right clicking on the log message with tag containing forward slash, the menu would be incorrectly displayed.
    • Fixed issue, where logcat package would freeze, if you would click Clear after disconnecting the device.
    • Add setting for controlling how many exited packages to show in package selection.
    • Add doc about known issue where logcat might work incorrectly if there more than one Editor instance running.
    • You can now navigate through messages using arrow keys.
    • Bump minimum Unity version support from 2019.2 to 2019.4
    • Screen Capture has the ability to capture videos from the device, see the documentation for more details
     
    mm_hohu likes this.
  38. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    I'm on Unity 2020.3.32 (LTS) and I don't see any Android Logcat versions after 1.2.3. How do we upgrade to 1.3.2? @Tomas1856
     
  39. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    It will automatically update in upcoming Unity versions, to update manually - you need to click See Other Versions in Package Manager.
     

    Attached Files:

  40. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    Thanks for the details. I did manually refresh the package list and clicked "See other versions" and it's still not showing up (no version ≥ 1.3.0 is showing up). Did they accidentally get marked for Unity 2021 only?

    Screen Shot 2022-04-20 at 5.18.13 PM.png
     
  41. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    1.3.0 won't show up, since it was only published internally, but 1.3.2 should show up. I am not sure why it's not showing up for you. There's Project Settings->Package Manager maybe some settings are off?

    Things to try:
    * Does 1.3.2 also not show up when you create a new Unity project?
    * You can go to Packages/manifest.json, and manually enter 1.3.2 version for logcat.
     
  42. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    Thanks for the suggestions. I tried restarting Unity and then I was able to get it to show up. I didn't change any other settings so I'm not sure what was going on. *shrug*
     
    Tomas1856 likes this.
  43. AntonPetrov

    AntonPetrov

    Joined:
    Dec 27, 2013
    Posts:
    63
    Hi!

    I am trying to symbolicate an ANR trace from the Firebase Crashlytics which looks like that:
    Code (CSharp):
    1. main (native): tid=1 systid=31739
    2. #00 pc 0x1e9612c libil2cpp.so
    3. #01 pc 0x1a05e34 libil2cpp.so
    4. #02 pc 0xcb5b9c libil2cpp.so
    5. #03 pc 0xbc25e0 libil2cpp.so
    6. #04 pc 0xbc82ec libil2cpp.so
    7. #05 pc 0xb99f98 libil2cpp.so
    8. #06 pc 0x17b7c64 libil2cpp.so
    9. #07 pc 0x1a03d78 libil2cpp.so
    I known it can be symbolicated because I checked in my Breakpad files but Android Logcat fails to do so.

    Would be great if you print out errors in the Unity Console if something goes wrong.
     
  44. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    In top right corner of main logcat window, there's Internal Log option, see if it prints anything.

    But most likely, it's because predefined regex expressions cannot determine where is address and where is library name in this line.

    In Stacktrace Utlity->Configure Regex add this Stacktrace Regex
    Code (CSharp):
    1. \s*#\d{2}\s*pc\s(?<address>[a-zA-F0-9]+)\s+(?<libName>lib.*)\.so
     
  45. AntonPetrov

    AntonPetrov

    Joined:
    Dec 27, 2013
    Posts:
    63
    When I press Resolve with the default placeholder test I see that `aarch64-linux-android-addr2line.exe` is executed.

    But when I copy paste my thread stack trace - the log does not change, nothing is written.
    So yeah, may be it is a regex.

    UPDATE:

    I did managed to symbolicate it with custom regex
    \s*#\d{2}\s*pc\s0x(?<address>[a-fA-F0-9]+).*(?<libName>lib.*)\.so


    Thank you!
     
    Last edited: May 23, 2022
  46. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    49
    I'm using Android Logcat 1.3.2 on Unity 2020.3.30f1. I've noticed that when I launch the Editor, an adb server process is started regardless of my current build target. When I quit Unity, that process remains running in the background. I have to manually run 'adb kill-server' from the command line to kill the process.
    Is this a bug?
    Note that I always have the Android Logcat window in the background in a "tabbed" view, behind the regular console.
     
  47. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    Please enable Rich text tags in Android logcat. It works well in unity editor console but not in logcat window

    2023-06-14 14:28:14.569 <color=#3BB674><b>I></b></color> Initializing with appId <b>asd23asd-4sdasd-ddas</b> : => member name: Log : => source line number: 86
     
  48. jiderish

    jiderish

    Joined:
    Aug 10, 2023
    Posts:
    1
    Please fix the illegible yellow warning text.
     
  49. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,875
    You can change the color in logcat preferences.
     
  50. yilianxin

    yilianxin

    Joined:
    Jan 22, 2015
    Posts:
    8
    My tag contains multiple messages with Unity as the keyword, and I only want to see tag messages for Unity and not Unityxxxxx.... What should I do?. upload_2024-3-23_1-8-45.png