Skip to content
iuryszaPublic

About

Keyboard-driven Android log viewer for the terminal: live adb logcat, record, replay, and NDJSON queries for agents.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

logcayo

logcayo

CI License: MIT Bun 1.4+ platforms: macOS • Linux

A modern terminal UI for Android logs.

logcayo-launch.mp4

Every screen is the real TUI running on a Samsung device capture.

logcayo streams adb logcat into a fast terminal viewer. Filter by level, tag, PID, package, or text as you type, then open any event to see its full message. Lines from one log call, such as a stack trace, stay together as one event. Record a session to a file and replay it later, on your machine or in CI.

  • Filter live with one query line, for example level:W tag:Database lock, with Tab completion from the session.
  • Inspect, copy, and pivot: jump from an event to its tag or PID in one key.
  • Classify logs with Jev in plain English, for example ~battery stats not saved, when you don't know the keyword. Press h to hide weak matches.
  • Record once, replay at any speed, and get the same results every time.
  • Let an agent query logs as JSON with logcayo query, without opening the viewer.

logcayo filtering a replayed session

Who is this for

  • Android developers who live in the terminal and want something faster than scrolling through Logcat in Android Studio.
  • Anyone chasing a bug in a noisy log. Record the session once, then replay and filter it as often as you need.
  • Coding agents and scripts. logcayo query returns structured NDJSON from a recording or a live device, so an agent can read logs without screen-scraping.

logcayo is not a log shipper or a crash reporter. It reads one device at a time on your machine.

Install

On macOS or Linux:

curl -fsSL https://github.com/iurysza/logcayo/releases/latest/download/install.sh | sh

The script downloads a standalone binary for your platform, checks its SHA-256 checksum, and puts logcayo in ~/.local/bin. You do not need Bun. Set LOGCAYO_INSTALL_DIR to install somewhere else, or LOGCAYO_VERSION=v0.4.1 to pin a release.

You need adb from the Android SDK platform tools only for live capture.

From source

You need Bun 1.4 or later.

git clone https://github.com/iurysza/logcayo.git
cd logcayo
bun install
cd packages/cli && bun link

bun link puts logcayo in ~/.bun/bin. You can also run it from the checkout with bun run logcayo.

logcayo is at version 0.4. Expect changes to commands and file formats.

Try it without a device

Download the sample recording and replay it. It uses the same layout as a real device capture, including named UIDs such as radio and a stack trace that repeats its header on each line:

curl -fsSLO https://raw.githubusercontent.com/iurysza/logcayo/main/tests/fixtures/real/sanitized-aosp-pattern.lvr.jsonl
logcayo replay sanitized-aosp-pattern.lvr.jsonl

Press /, type level:W, and press Enter. Press ? for all keys, and q to quit.

Watch a device

Connect a device with USB debugging on, then run:

logcayo live

If more than one device is connected, pass --serial DEVICE. adb devices lists the serials.

To keep a session for later:

logcayo record --out sessions/bug.lvr.jsonl --duration 60
logcayo replay sessions/bug.lvr.jsonl --speed 4

--speed instant loads the whole recording at once.

Keys

Key Action
↑ ↓ or j k Select the previous or next event
PgUp PgDn or Ctrl-U Ctrl-D Move one page
G or End Follow the newest logs
Home Go to the first event
/ Edit the query. Tab completes, ↑ ↓ recall earlier queries
x / u / c Clear filters, undo the last filter change, copy the query
f Change filters
Enter Inspect the event. In the inspector, t filters by tag and p by PID
y Copy the selected event
w Turn line wrapping on or off
b Turn the list background on or off
[ ] / h Jev only: lower or raise the threshold, hide or show weak matches
? Show help
q or Ctrl-C Quit

Set NO_COLOR=1 for plain output.

Query language

One query line filters the viewer and the CLI:

level:W tag:Database pkg:com.example.app "lock timeout"
  • level: shows that level and above: V, D, I, W, E, or F.
  • tag:, pid:, and pkg: match those fields. pkg: resolves the package to its app UID.
  • Other words search the message text. Use quotes around text with spaces.

Query line and Jev has the full grammar.

Query logs from an agent

logcayo query streams matching events as NDJSON: one JSON object per event, then a summary line. It never opens the viewer or writes files.

logcayo query sessions/bug.lvr.jsonl 'level:W tag:Database lock' --limit 20
logcayo query --live 'pid:4321' --timeout 5s
logcayo query --check 'level:w tag:Database'

--check validates a query and prints its normalized form. Live queries stop after 10 seconds unless you pass --timeout. Run logcayo query --help for every option.

logcayo query streaming NDJSON

Ask questions with Jev (optional)

Some bugs are hard to match with keywords. Jev is a hosted classifier from TypeSafe. It scores each log line against a question such as "database locks" or "why did the app restart".

Jev is off by default. It is a paid service and needs an API key. When it is on, logcayo sends the text of matching log lines to TypeSafe. Do not use it on logs that must stay on your machine.

To use it:

  1. Get an API key from TypeSafe and set TYPESAFE_API_KEY. Without it, Jev stays off.
  2. In the query line, put ~ before a question: level:W ~database locks.

Keyed terms such as level: still filter on your machine first. Jev scores only the events that pass them. In the viewer, a question runs when you press Enter, not while you type. Remove the ~ to go back to text search. [ and ] change the score threshold, and h hides or shows low-scoring rows.

Asking Jev about database locks

Agents can ask the same question about a recording: logcayo query sessions/bug.lvr.jsonl '~database locks'. logcayo query --live does not support Jev.

Documentation

Name

logcayo is named after Leopardus tilcayo, a spotted cat from the Bolivian Andes and the first new cat species found in 100 years. It hid in plain sight for years. So do the log lines you're looking for.

License

MIT

About

Keyboard-driven Android log viewer for the terminal: live adb logcat, record, replay, and NDJSON queries for agents.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors

Languages