- Home /
How to read Debug.Log when using Android?
I just tried my app on Android and it suddenly doesn't work well (on Windows it works fine). Is there a way to see unity console's errors and debug.log messages- when I run the device on Android?(I use development mode and script Debugging).
I connected adb to the device, and can also use logcat and filter to "unity", but it still shows a crazy log.
All I want to see is a clean log that shows errors and my Debug.Log messages which I usually can see easy and clear on the Unity Console on Unity on Windows.
Answer by Umresh · Jun 22, 2017 at 04:59 AM
If you have android studio you can use it's logcat. Or in cmd you can run this command
adb logcat -s Unity PackageManager dalvikvm DEBUG
For everyone looking now here: There is also a Logcat Plugin available in the Package $$anonymous$$anager. You can read the Android Logs directly in your Unity Editor. Edit: https://docs.unity3d.com/Packages/com.unity.mobile.android-logcat@1.2/manual/index.html
Answer by jolasman · Mar 14, 2018 at 08:01 PM
I have a solution in my new video :)
jolsman you saved my day , thank you ! , your video works for me
I watched your video, but monitor.bat cannot be opened. "'lib\monitor-location' couldn't be found. ..." Any ideas how to fix?
hi :) had you installed the Android SD$$anonymous$$ correctly? Did you install it through the Android Studio installation? Are you in the correct path for your SD$$anonymous$$? I have another possible solution for the logs by printing the logs into a file. You can see the tutorial here :link text
I hope this helps you :)
Just in case, I had the same problem lib\monitor-location not found, and this is how I solved it:
First, because I have several Unity versions installed in my PC, each one with its own Android tool installs, I ran adb in the specific folder of my Unity Version (e.g. C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools
The monitor.bat spits and error in my case, complaining that lib\monitor-location cannot be found, so I navigated to C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\lib\monitor-x86_64 and ran monitor.exe from there.
That didn't work either, complaining that there was no JDK installed, so I added temporarily the JDK to the path by doing "set PATH=%PATH%;C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\jre\bin" and only then I could run monitor.exe
Answer by Brad-Newman · Jun 14, 2019 at 07:38 AM
This command works for me to see Debug.Log messages for the Oculus Quest:
adb logcat | findstr -i unity
Your answer
Follow this Question
Related Questions
How to disable all logging on release build? 5 Answers
Android Logcat for Unity3D Debugging 1 Answer
Keep getting AudioTrack messages when I use Android logcat with my unity app. 0 Answers
Game crashed after display splash screen on android. 1 Answer
Shader source code in Logcat on Android then Crashes the newly build apk 1 Answer