How to make `adb logcat` not show past output?
Aug 31, 1:26am

To make adb logcat not show past output (i.e., only display new logs as they arrive), you can use the -c (clear) flag to clear the existing log buffer before starting the log output.

Command:

bash
adb logcat -c

This clears the existing logs, and then you can run adb logcat again to see only new logs.


Alternative: One-Liner

If you want to clear and start logging in a single command, use:

bash
adb logcat -c && adb logcat

This ensures you only see logs generated after running the command.


Additional Tips

  • Filter logs: Use -s to filter by a specific tag (e.g., adb logcat -s MyApp).
  • Persistent logs: If logs persist, check if your device or emulator has a persistent log buffer. Some custom ROMs or devices may require additional flags or root access to fully clear logs.
Aug 31, 1:26am

This is a shared conversation and may include unverified content that doesn't reflect Mistral AI's views. Login to resume chatting.

Vibe can make mistakes. Check answers. Learn more