-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Description:
Hi professor, I encountered a major blocker while generating code coverage for my instrumented application. The issue was that I was capturing and saving logcat logs using PowerShell on Windows, which by default saves files in UTF-16 encoding. However, AndroLog expects UTF-8 encoded log files for parsing. This caused me to consistently get 0% code coverage despite having valid METHOD entries in my logs.
Root Cause:
PowerShell's > redirect operator saves files in UTF-16 LE (with BOM) by default, which breaks AndroLog's log parser. This is a Windows PowerShell-specific issue that doesn't affect Mac/Linux users where the default encoding is UTF-8.
Solution:
After modifying my PowerShell command to explicitly save the output as UTF-8, the code coverage generation worked correctly.
Working command for Windows PowerShell users:
adb logcat -v threadtime MY_SUPER_LOG:D *:S | Out-File -FilePath logs.txt -Encoding UTF8Suggestion:
It would be helpful to add a note in the README about this Windows PowerShell-specific encoding issue to help future users avoid this problem.