Issue
I've an app that generates logcat with the following command:
logcat -d -v time -t 1620059528.0 *:W
However, its output is different from the output I get if I run the exact same command from the console via
adb logcat -d -v time -t 1620059528.0 *:W
The logs begin at different times, one is much bigger than the other, the output is different.
Why is this? Running Android 11 here.
EDIT: I am calling logcat through
Process process = Runtime.getRuntime().exec("logcat -d -v time -t 1620059528.0 *:W");
Does this prints ONLY the logcat from the running package?
Solution
Yes, apps can only access their own logs since Android 4.1 for security reasons.
This is expanded on in this Android StackExchange answer, which also mentions you can (allegedly, and in 2013) gain full device log access if you own the device with:
adb shell pm grant <pkg> android.permission.READ_LOGS
Answered By - Jake Lee
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.