Search Unity

Feedback Android Logcat Package Feedback

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

  1. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    "Open Terminal" button not working on MacOS

    Code (CSharp):
    1. Win32Exception: Cannot find the specified file
    2. System.Diagnostics.Process.StartWithShellExecuteEx (System.Diagnostics.ProcessStartInfo startInfo) (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    3. System.Diagnostics.Process.Start () (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    4. (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
    5. System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    6. System.Diagnostics.Process.Start (System.String fileName, System.String arguments) (at <ae22a4e8f83c41d69684ae7f557133d9>:0)
    7. Unity.Android.Logcat.AndroidLogcatUtilities.OpenTerminal (System.String workingDirectory) (at Library/PackageCache/com.unity.mobile.android-logcat@1.0.0/Editor/AndroidLogcatUtilities.cs:230)
    8. Unity.Android.Logcat.AndroidLogcatConsoleWindow.OnGUI () (at Library/PackageCache/com.unity.mobile.android-logcat@1.0.0/Editor/AndroidLogcatConsoleWindow.cs:423)
    9. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    10. Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    11. System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    12. System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    13. UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    14. UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    15. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    16. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    17. UnityEditor.DockArea.OldOnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    18. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
    19. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
    20. UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
    21. UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
    22. UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:93)
    23. UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
    24. UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
    25. UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
    26. UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
    27. UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
    28. UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    29.  
     
  2. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    >> Moved Android Settings under Preferences->Analysis

    Is it still there? Can't find Analysis under Edit->Preferences
     
  3. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Android Logcat doesn't show anything when connected to an LG6 device running Android 8.0.0. I enabled USB debugging on the device and authorized the PC to connect to it. Any suggestions?
     
  4. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    What's MacOS version are you using, can you spawn terminal manually?


    Still there, ensure package is installed, and active platform is Android

    In the top right corner in Android logcat window, click on context menu, and select Internal Log, see if any executed adb logcat commands show any errors
     
  5. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    Yes, the package is installed. I'm using it. And Android is selected:
    platform.PNG

    No Analysis in Preferences:
    prefs.PNG

    I restarted Unity a couple of times, but that didn't help.
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    You need to check internal log.
    In the top right corner in Android logcat window, click on context menu, and select Internal Log, see if any executed adb logcat commands show any errors

    I think your Android device is simply not sending logs for some reasons, I heard about similar problems on other LG phones as well
     
  7. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    I agree that it has to be an adb problem. I'm have logcat working fine with another phone on the same computer. The LG phone doesn't show anything even when I use adb logcat from command line. I know that it's not a connection issue because I can install .apk files via adb.
     
  8. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    Yes, I can spawn terminal manually, I'm on MacOS Catalina 10.15.2
     
  9. Sparkline

    Sparkline

    Joined:
    Feb 8, 2013
    Posts:
    121
    Hello!
    Just installed Unity 2019.3.0f6
    Started new project and switched build target to Android
    Installed Android Logcat 1.0.0 via package manager
    Connected my device via USB (usb debugging enabled)
    Opened Logcat window but it tells me that no device connected 5.png

    When I try to select device from dropdown list I get an error in console 4.png
    Though I have adb installed and it works correct long time ago.
    CMD:
    2.png
    Android Monitor:
    3.png

    Any suggestions? Tried to reinstall USB driver, restart Unity
     
  10. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Are you able to build for Android via Unity, also can you click on the error, and copy paste the stacktrace.

    Alternatively, enable preview packages in Package Manager, and download latest logcat preview package.
     
  11. Sparkline

    Sparkline

    Joined:
    Feb 8, 2013
    Posts:
    121
    I fixed it with unchecking these checkboxes in Edit =>Preferences => External Tools 2020-02-03_150343.png

    Now everything works as i should! Thanks
     
  12. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    I guess for some reason Unity didn't find Android SDK, we can improve the error message if that helps
     
  13. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    Hey Tomas, did you get a chance to test the Open Terminal button on MacOS Catalina?
     
  14. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Sadly I cannot reproduce this locally, everything works fine on my end, something's is probably different in my environment

    In the meantime, you could try to check this on your end.
    * Open a project where you added Android logcat package
    * Expand Project inspector, expand Packages, Right click on 'Android Logcat', it should open the folder in Library/PackageCache
    * Copy paste com.unity.mobile.android-logcat@.... to <your_project>\Packages
    * Inside com.unity.mobile.android-logcat@.... delete Tests folder, it might cause you compile errors
    * Unity should start using Android Logcat source from <your_project>\Packages\com.unity.mobile.android-logcat@....
    * Open C# project, AndroidLogcatUtilities.cs file, locate OpenTerminal function
    Code (CSharp):
    1.        public static void OpenTerminal(string workingDirectory)
    2.         {
    3.             switch (Application.platform)
    4.             {
    5.                 case RuntimePlatform.WindowsEditor:
    6.                     System.Diagnostics.Process.Start(“cmd.exe”, string.Format(/K \“cd {0}\“”, workingDirectory));
    7.                     break;
    8.                 case RuntimePlatform.OSXEditor:
    9.                     System.Diagnostics.Process.Start(@“/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal”, workingDirectory);
    10.                     break;
    11.                 default:
    12.                     throw new Exception(“Don’t know how to open terminal on ” + Application.platform.ToString());
    13.             }
    14.         }
    * Validate if Terminal.app is really in that path above
     
    AllanRW likes this.
  15. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    That made it, my Terminal path is slightly different:

    /System/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal
     
    Tomas1856 likes this.
  16. AllanRW

    AllanRW

    Joined:
    Nov 6, 2014
    Posts:
    37
    Hey Tomas,

    This MacOS path issue will be fixed on next update? We have a lot of projects and would be to fix these manually. This package is very useful for us! Thank you!
     
  17. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Yes, the new package version should be released next week. Sorry for the delay
     
    AllanRW likes this.
  18. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    1.1.0 was released, basically it's an accumulation of previous preview packages + additional fixes, here's the full list
    Fix & Improvements.

    • Added feature 'Filter by process id'
    • Fixed addr2line functionality, when we try to resolve stacktrace
    • Correctly open Terminal on macOS Catalina
    • Fix Open Terminal button not working on Windows sometimes.
    • Reworked Connect to IP window, it's now multithreaded, thus it will not lock Editor. It's now easier to connect to Android device via IP.
    • Added icons for messages
    • Added disconnect button, you can stop logcat messages this way.
    • Improved mouse right click behavior to be consistent with the rest of Unity
    • Correctly identify Android 9 version
    • Android Settings will have color settings separated between Free skin and Pro skin.
    • Moved Android Settings under Preferences->Analysis
    • Provide proper windows title for Stacktrace Utility window
    • Right clicking log lines behavior will be consistent with other Unity windows.
    • Ctrl/CMD + C will copy log lines correctly.
    • Column seperators will be drawn correctly
    Android Logcat Settings
    • Introducing settings, accessible from Preferences. For ex., on Windows Edit->Preferences
     
  19. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    1.2.0-preview was released (to access it, you'll need to tick Advanced->Show Preview Packages in Package Manager)

    Fix & Improvements
    • Android Logcat per project settings are saved in ProjectSettings directory.
    • Fix issue where sometimes Android Logcat would stop working if USB cable is unplugged and replugged.
    • Properly save/restore Android Logcat settings, previously settings like tags were being lost during domain reload or Editor restart.
    • Added Capture button in Capture Screen window, also capturing screen no longer will lock Unity thread.
    • Fix issue where incorrect date format in incoming log message would break whole log parsing.
    • Moved Stacktrace Utility, Capture Screen, Open Terminal under Tools menu.
    • The package list will automatically clean itself, if there's more than 5 exited packages in the list;
    • Improved documentation.
    • Added Clear button in internal log window.
    • Minimum Unity version was raised to 2019.2. The reason was to drop .NET 3.5 support.
    • 'Enter IP' window got renamed to 'Other connection options.
    • In the device selection list, you'll also able to see disconnected and unauthorized devices for informational purposes.
    • 'Other connection options' window has a Disconnect button for devices connected via Network.
    • Added device selection in Screen Capture window
    MemoryWindow
    • Introduced a window for viewing application memory in real time, more information in the docs.
    MemoryControls.png
     
  20. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    With the latest Unity 2019.3.13 and Logcat 1.1 or 1.2 I cannot see the messages anymore.
    I can see everything <Time,PID,Tid, Priority, Tag> but the message field is blank.
    It happened before but I was able to get it working by enabling and disabling regex button, but now the fix doesn't work anymore.
     
  21. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Try clicking in top right left corner, internal log, and see if there's anything suspicious. Also what OS does your Android device have?
     
  22. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Now it restarted working on its own, don't know what changed.
    The device is an Asus zephone 3 Ultra with Android 7.0.
    If it reappear I'll try to copy the log.
     
  23. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    It happened again.

     
  24. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    The command
    Code (CSharp):
    1. 5:30:16.7578 E:/AndroidSDK/sdk\platform-tools\adb.exe -s H4AKCX002625XGK logcat --pid=16162 -v year *:V
    Contains filter by process id, I assume this is a process id of a package you have selected ?
     
  25. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    I also found out the package tend to stall and slow down the application when switching scenes after a while,
    Yes, "xxxxxxxxxxxxxxxx" is actually the package name censored since it's not released yet I don't want to divulge the name.
     
  26. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Try executing

    Code (CSharp):
    1. E:/AndroidSDK/sdk\platform-tools\adb.exe -s H4AKCX002625XGK logcat --pid=16162 -v year *:V
    manually, after clicking Open Terminal.

    Note: --pid will be different on each application run.
     
  27. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Ok, I have to wait that it happens again, cause right now it restarted working on its own.
     
  28. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I love the logcat window so far. It has been very helpful.

    I've been building a customized build & management tool for our project and was wondering, if I could use the adb calls asynchronously for my own purposes. The ADB class API is publically available, it has the
    GetInstance
    and
    Run
    methods. However the
    Run
    method is synchronous. So using that will freeze it up for a few seconds when it is starting the ADB server.
    Is there or will there be public API available to run adb commands asynchronously and getting the results back when it is done?

    I'm using the ADB class to fetch my own device list to select a device and install / reinstall a selected apk file. Also made a packages list so I can easily uninstall apps from the target device.

    I could create the API myself but if Unity already has it available in the Logcat package it wouldn't make sense to not use it of course. But I can't find out how to run it async with the current public API.
     
  29. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    I think you can already call ADB.Run function from any thread. Logcat package itself does that, just check the logcat package source and search for QueryDevicesAsync, which is executed on worker thread.
     
  30. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    I've looked into it and it all seems to be either private or internal. The QueryDevicesAsync does indeed call the Run method. But the method itself is not async. It seems to be called asynchronous through a "Dispatcher" which runs the Action on a Thread. It is quite a complex setup to read through.
    I was actually hoping to just have a RunAsync method and let the internal Dispatcher do its job.

    But I guess I could run a thread then call the Run method then get back to the main thread to handle the result.

    Task.Run(() => devices = adb.Run(new[] { "devices" }, string.empty));
     
    Last edited: Jul 22, 2020
  31. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    I see what you mean now, as far as I am aware there are no plans for RunAsync method for ADB class
     
  32. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035

    You can try my code, taken from Unity answers and adapted to install and run apk, cause I think it's crazy that in 2020 I had to rebuild the apk just to test a new device.
    For my project I also did an editor gui with some checkboxes to select the action to perform after the build, install and run.


    Code (CSharp):
    1.  
    2.     public static void ExecuteCommandAsync(string executable, string argument, System.Action onEnd = null)
    3.     {
    4.         var thread = new System.Threading.Thread(delegate () { ExecuteCommand(executable,argument,  onEnd ); });
    5.         thread.Start();
    6.     }
    7.     public static void ExecuteCommand(string executable,string argument, System.Action onEnd=null)
    8.     {
    9.         try
    10.         {
    11.            
    12.             UnityEngine.Debug.Log($"============== Start Executing {executable} { argument}  ===============");
    13.  
    14.             System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(executable)
    15.             {
    16.                 WorkingDirectory = "/",
    17.                 UseShellExecute = false,
    18.                 RedirectStandardOutput = true,
    19.                 RedirectStandardError=true
    20.             };
    21.             System.Diagnostics.Process myProcess = new System.Diagnostics.Process
    22.             {
    23.                 StartInfo = startInfo
    24.             };
    25.             myProcess.StartInfo.Arguments = argument;
    26.             myProcess.Start();
    27.             string output = myProcess.StandardOutput.ReadToEnd();
    28.             string error = myProcess.StandardError.ReadToEnd();
    29.            
    30.             UnityEngine.Debug.Log($"Result for {executable} { argument} is : \n{output}");
    31.             if(!string.IsNullOrEmpty(error))  UnityEngine.Debug.LogError($"Error for {executable} { argument} is : \n{error}");
    32.             myProcess.WaitForExit();
    33.             UnityEngine.Debug.Log("============== End ===============");
    34.             if (onEnd!=null) onEnd();
    35.         }
    36.         catch (System.Exception e)
    37.         {
    38.             UnityEngine.Debug.Log(e);
    39.         }
    40.     }
    41.     void RunPlayer(string AppID)
    42.     {
    43.        
    44.         string args = $" shell monkey -p {AppID} -c android.intent.category.LAUNCHER 1";
    45.         ExecuteCommandAsync("adb", args);
    46.  
    47.     }
    48.  
    49.     void InstallPlayer(bool RunToo=false)
    50.     {
    51.         string AppID = Application.identifier;
    52.  
    53. #if UNITY_ANDROID
    54.         char Separator ='/';
    55.         //string Extension = ".apk";
    56. #else
    57.         char Separator ='/';
    58.         string Extension = ".apk"; //Need to change for IOS, haven't worked on it yet.
    59. #endif
    60.  
    61.         string ProjectPath = Application.dataPath.Substring(0, Application.dataPath.LastIndexOf(Separator));
    62.         string PlayerPath= ProjectPath + Separator + PlayerName;
    63.  
    64.         ExecuteCommandAsync("adb", "install -r -d " + PlayerPath,
    65.             ()=>
    66.             {
    67.                 if(RunToo)
    68.                 RunPlayer(AppID);
    69.             });
    70.        
    71.  
    72.  
    73.  
    74.     }
     
  33. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    Yeah well I went with Task.Run and run the method to call ADB asynchronously (such as refreshing device list, package list etc).
    I've got my own Editor UI now set up to be able to select an android device and install, uninstall and run applications on that selected device. Even built in to connect with it wirelessly. It's not perfect but it does smoothen the experience of managing things via Unity.
     
    00christian00 likes this.
  34. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    1.2.0 is verified now.

    Changelog

    Fix & Improvements.

    • Correctly resolve top activity when device is locked.
    • Improved Stacktrace Utility, it's easier to set symbol paths and regexes.
    • Consola font is now selectable in Logcat settings.
    • Android Logcat per project settings are saved in ProjectSettings directory.
    • Fix issue where sometimes Android Logcat would stop working if USB cable is unplugged and replugged.
    • Properly save/restore Android Logcat settings, previously settings like tags were being lost during domain reload or Editor restart.
    • Added Capture button in Capture Screen window, also capturing screen no longer will lock Unity thread.
    • Fix issue where incorrect date format in incoming log message would break whole log parsing.
    • Moved Stacktrace Utility, Capture Screen, Open Terminal under Tools menu.
    • The package list will automatically clean itself, if there's more than 5 exited packages in the list.
    • Improved documentation.
    • Added Clear button in internal log window.
    • Minimum Unity version was raised to 2019.2. The reason was to drop .NET 3.5 support.
    • 'Enter IP' window got renamed to 'Other connection options.
    • In the device selection list, you'll also able to see disconnected and unauthorized devices for informational purposes.
    • 'Other connection options' window has a Disconnect button for devices connected via Network.
    • Added device selection in Screen Capture window
    Memory Window
    • Introduced a window for viewing application memory in real time, more information in the docs.
     
    fherbst and Prodigga like this.
  35. Anastasia-Devana

    Anastasia-Devana

    Joined:
    Aug 18, 2013
    Posts:
    20
    Tiny UX request. When I highlight a line in the logcat window, I'd love to be able to use up / down arrows to navigate to the next / previous line
     
  36. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Logged
     
    Anastasia-Devana likes this.
  37. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Thanks for providing the Android Logcat package, I use it a lot!

    One issue though: Why are the settings stored within the ProjectSettings folder? This is causing a lot of version control noise when used by our team:

    upload_2020-11-25_18-50-12.png

    I don't want our developers fighting over the size of their windows in source control. :D

    Would it make sense to move this file into a per-user directory such as UserSettings? I believe so because nothing in there looks like something I want to share with others. But if there were such properties, I'd like the files to split into project and user settings. :)
     
    Last edited: Nov 25, 2020
    Prodigga and fherbst like this.
  38. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Yes, that's an oversight :) there was already another person who reported that. You can add logcat settings file to .gitignore for now, sorry for the inconvience.
     
    fherbst, Xarbrough and Rabadash8820 like this.
  39. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    1.2.1 is available now

    Fix & Improvements.
    • Removed limitation where Android Logcat could only be used while the active Editor platform is Android. Note: Android Support is still required to be installed for Android Logcat to work.
    • Fix Memory Window on Android 11. Android 11 started dumping RSS memory, which was previously unexpected by Memory Window.
    • Include RSS memory in Memory window.
    • Moved ProjectSettings\AndroidLogcatSettings.asset to UserSettings\AndroidLogcatSettings.asset, since this file wasn't meant to be commited.
    • Fix various issues where logcat would incorrectly perform search on the phone below Android 7.0
    • Display the information in status bar by which data the messages are filtered, this should help with situtions where no messages are displayed logcat, only because a very specific tag or search filter is set.
    • Correctly get process name on Android 5.0 devices, previously processes with names like /system/bin/netd, would be resolved incorrectly.
    • You can now specify symbol path without CPU archtecture, if crash line will contain information about ABI, stacktrace utility will append the required CPU architecture.

    Changes
    • Memory window will be disabled by default, since it causes Explicit concurrent copying GC freed messages to be printed in the logcat which might be unwanted behavior.
    • Remove automatic stacktrace resolving when receiving logcat messages, since in some cases it's impossible to automatically determine the correct symbol path, this creates a misleading behavior, where displayed stacktraces are incorrect. Please use Stacktrace Utility instead.
     
    Prodigga and Xarbrough like this.
  40. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Thanks for the update! One question, do you have on the roadmap that when running an application X times, you always have to select the "running" version again, it doesn't pick it up automatically? It's stuck on "exited" processes all the time, which is pretty annoying if you're waiting for logs to come in.
     
  41. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    The filtering is done by process id and since the new run is associated with new process id, that behavior is expected. You also might be interested in the exited process logs, especially if there's a crash, and automatic switch to active process might be undesired.

    Wondering what would be a good UI for this.
     
  42. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    When the app crashes and you don't re-start it yourself it shouldn't be a problem right?
    but upon booting a unity app that can be debugged it might be nice to have it automatically select it.
    if people don't want this behaviour, a simple toggle in settings would suffice I'd say.
     
  43. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Toggle might be an option in this case, I added this feedback to our roadmap. Thanks!
     
    fherbst likes this.
  44. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    I agree - but the point here is "might", whereas you're "nearly always" interested in the logs from the build you just made. If I want to check crash logs of a previous run then that should be a dedicated action, whereas right now it's pretty annoying (and I forget it all the time) that I have to manually select the current run after pressing "Build & Run". Especially for logs at startup having to select it manually means I'm missing these in some cases.
     
  45. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Hmph, if you click Build & Run, it should connect to new launched app. I thought your scenario is - close/crash app on Android, and launch it again by touching the game icon.

    If Build & Run doesn't connect to new launched app, that's a bug
     
    fherbst likes this.
  46. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Yep, that's what I meant - if you do Build & Run, the first time it autoconnects, if you then e.g. quit the app and do Build & Run again it's stuck at the "old" log. (Same if you just Build & Run without quitting manually)
     
  47. SleepyWolfie

    SleepyWolfie

    Joined:
    Jun 8, 2020
    Posts:
    36
    Hello! Im just here to report a possible bug on the Android Logcat v 1.2.0 (the one present on 2019.4.20f). I dont know what might be causing this, but the logcat (when activated) causes constant big frame spikes on the android phone which renders many games unplayable. I think it might be the new Heap Allocation feature that i haven't seen in 1.1 (dont know when it was added).

    The phone was a Huawei P Smart, not very high end admitedly. Still its something that happens that didnt happen before 1.2.0.
     
  48. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,917
    Can you try updating to 1.2.1, alternatively disable memory window from logcat window tabs
     
  49. SleepyWolfie

    SleepyWolfie

    Joined:
    Jun 8, 2020
    Posts:
    36
    Updating to 1.2.1 seemed to fix it. Thanks! I thought 1.2.0 was the latest version...
     
    Tomas1856 likes this.
  50. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,454
    In Unity 2020.3.0f1 using Android Logcat 1.2.1 "Verified" package, I get no logcat logs when running logcat (with no filter of course). I am using a Sony Xperia XZ3 with Android 10

    If I roll back to 1.2.0 version, logcat works fine again

    With 1.2.1 package, the log output is this then nothing else after:

    Code (CSharp):
    1. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of system
    2. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of crash
    3. 2021/03/23 21:00:00.054 1754 1812 Warn Looper Slow delivery took 221ms android.fg h=com.android.server.adb.AdbDebuggingManager$AdbDebuggingHandler c=null m=2
    4. 2021/03/23 21:00:00.054 1754 1812 Warn Looper Slow dispatch took 925ms android.fg h=com.android.server.adb.AdbDebuggingManager$AdbDebuggingHandler c=null m=2
    5. 2021/03/23 21:01:24.077 1754 1812 Warn Looper Slow delivery took 242ms android.fg h=com.android.server.adb.AdbDebuggingManager$AdbDebuggingHandler c=null m=2
    6. 2021/03/23 21:01:24.078 1754 1812 Warn Looper Slow dispatch took 908ms android.fg h=com.android.server.adb.AdbDebuggingManager$AdbDebuggingHandler c=null m=2
    7. 2021/03/23 21:01:27.046 1754 1812 Warn Looper Slow delivery took 217ms android.fg h=com.android.server.adb.AdbDebuggingManager$AdbDebuggingHandler c=null m=1
    8. 2021/03/23 21:01:27.585 1754 1812 Info ActivityTaskManager START u0 {flg=0x10000000 cmp=com.android.systemui/.usb.UsbDebuggingActivity (has extras)} from uid 1000
    9. 0001/01/01 00:00:00.000 -1 -1 Info  --------- beginning of main
    10. 2021/03/23 21:05:16.402 20108 20259 Info facebook.katan WaitForGcToComplete blocked ClassLinker on Debugger for 189.594ms
    11.