What can I do to prevent Android Studio from automatically clearing my log

I have activity, when it starts, it crashes, but leaves no trace of what went wrong in the console. I see a short brief text before clearing it. The drop-down list that shows the debugged application quickly switches from my application to "no debugged applications" and back in no time.

Is there a way to prevent this behavior?

+7
android android-studio adb
source share
4 answers

You must disable ADB integration:

Tools -> Android -> Enable Integration with ADB

There should not be an icon in front of this menu item.

Your LogCat now saves log output after closing the application or crashing the application.

+4
source share

Look at the Android Studio console and find the drop-down list that says "Show only selected application." Change it to No Filters to see all output on an Android device. You will need to go on to detect your failure, but your class names, etc. And the log tags will be there, so it will not be too complicated.

No filters

0
source share

You can save the record to a file. Go to your terminal and type adb logcat > logfile.txt

(If you did not, before you need to add the platform-tools directory of your sdk to your path. See the link http://www.troubleshooters.com/linux/prepostpath.htm )

0
source share

I have not found a good solution for this behavior, but there are several alternative strategies for displaying the logarithm.

Firstly, logcat is actually available in two places in Android Studio. The first is the logcat tab in the debug panel, which gives me the most trouble. The second is the logcat tab in the Android panel, which usually works a little better. If there is nothing there, usually setting the filter to "no filter" and the log level to "error" will lead me to where I want to be.

Secondly, you can always run logcat from the command line. The result will not be as beautiful or easily filterable, but you can write it to a text file and search there. I usually use adb logcat -v time > logcat.txt to include timestamps and write logs to a text file.

0
source share

All Articles