logcat: couldn't open output file '/storage/logFile.txt': Permission denied

54 Views Asked by At

How to get permission to save logcat history as file?

Tried: ./adb logcat -f /storage/logFile.txt logFile.txt already exist឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵ ឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵឵

1

There are 1 best solutions below

0
Robert On BEST ANSWER

I assume you have a PC (or Mac) and an Android device connected via adb (e.g. USB) to the PC

If you execute adb logcat on your PC then the command you execute is adb hence if you redirect standout to a file you need to use a path on your PC not on your phone.

If you want to save the logcat output on your phone you need to open a shell, execute logcat there and then redirect the output to a file:

adb shell "logcat -f /storage/logFile.txt"