AppInspect
On this page
Panels

Logcat

A live terminal tail of your app's own log output, on the device, with no cable and no adb. It shows everything written with Log.v through Log.wtf — by your code and by every library in the same process, so OkHttp, Firebase, WorkManager and framework messages all appear. It opens from the terminal icon in the top bar.

Why it is a panel at all

Logcat is normally the first thing a developer reaches for and the last thing a tester can get to. The moment the phone is not plugged into your machine, the most detailed record of what just happened is unreachable — so the bug report says “it froze” instead of carrying the exception that caused it. This panel closes that gap: the person holding the device can read the log, filter it, and share the relevant lines as a file.

Reading the tail

The rendering is deliberately terminal-like: monospace, one line per record, a coloured level stripe down the left edge, and the level colours you already know from Android Studio. Warnings and above tint the whole message; everything below stays neutral, so colour keeps its value for scanning instead of becoming decoration.

  • Filters — level chips (V/D/I/W/E/A), a tag picker, and free-text search across message and tag, with a .* toggle for regular expressions. Matches are highlighted inline.
  • Pause freezes the view while capture continues underneath, so a burst cannot scroll a stack trace away while you are reading it.
  • Follow tail auto-scrolls, yields the moment you drag away from the bottom, and re-arms when you return; a button jumps you back.
  • Wrap and Redact live in the status bar, which also reports how much of the buffer is in use and how many entries retention has evicted.

Tap a line to expand a folded stack trace — wrapped continuation lines are parsed back into the record they belong to, rather than arriving as loose lines. Long press to copy one, and share the visible, filtered lines as a .txt in logcat's own layout.

No permission, no storage, no idle cost

Three properties worth stating plainly, because together they are the reason this panel is cheap enough to leave switched on.

PropertyHow
No permission READ_LOGS has not been grantable to ordinary apps since Android 4.1, so capture is constrained to this process's own pid — the only log Android lets an app read. Another app's output is never visible, by construction.
No storage Entries live in a bounded in-memory ring buffer and nowhere else — no file, no row in appinspect_storage.db, nothing to back up or clean up. A chatty app out-logs its own network traffic by orders of magnitude; persisting that would grow the database without limit.
No idle cost Capture is on demand. No reader thread and no logcat process exist until the page is opened, and both are torn down when it closes.

Scroll-back still works despite the on-demand model, because Android's own log buffer supplies it: opening the page replays the most recent lines and then keeps streaming. The buffer is discarded when the process dies, which is the right lifetime for a live tail.

If a device refuses --pid

A few vendor ROMs ship a logcat that rejects pid filtering. Capture escalates rather than giving up: it drops to an unfiltered command and filters by pid in-process, discarding lines that belong to anything else. If no variant produces output at all, the panel says logcat is unreadable on this device — rather than showing an empty list that looks like “no logs”.

Redaction, and why it matters more here

Log lines are the most likely place for a secret to appear even when every other panel is clean, because logging libraries print things you did not choose: OkHttp's own HttpLoggingInterceptor writes Authorization headers straight to logcat.

The panel's Redact toggle masks sensitive values using the same redaction rules as the rest of the library, and it governs the export as well — the export header records which mode produced the file. Masking happens at render and export time rather than at capture, so the toggle works in both directions without re-reading the device buffer, which could not recover the original anyway.

Because free text has no structure, matching is best-effort: it recognises "key":"value", key=value and key: value shapes, and cannot catch a value printed with no key beside it. Treat a Logcat export exactly like a network export — the QA checklist applies unchanged.

Sizing and switching it off

The defaults suit an app that logs normally. Raise the buffer if you are chasing something that happens minutes before you notice it; the cost is only RAM, since nothing is written to disk.

AppInspectLogsConfig
AppInspectLogsConfig(
    bufferSize = 2_000,             // entries kept in memory; clamped to 100..20,000
    initialBacklogLines = 1_000,    // lines replayed from the device log on open
    maxMessageLength = 8_000,       // per-message character cap
    redactSensitiveValues = null,   // null follows powerTools.showRawSensitiveValues
)
bufferSizeRoughly
2,000 (default)0.4–0.8 MB
5,0001–2 MB
20,000 (maximum)4–8 MB

maxMessageLength caps a single message so one enormous stack trace or pretty-printed response body cannot consume the whole budget on its own; a cut message says so. To remove the panel entirely, set AppInspectPanels(logsEnabled = false) — the terminal icon disappears and no capture is ever started.

In a build where the library is disabled, none of this exists: the page is only reachable from an inspector that refuses to open, so no logcat process is ever spawned. Under appinspect-no-op the capture code is not in the APK at all — see the security model.