extracting-logs-with-logcat
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseExtracting Logs With logcat — Reading Device Logs
使用 logcat 提取日志——读取设备日志
This skill covers end-to-end: streaming vs dumping, buffer selection, filter expressions, format flags, PID and time filters, file rotation, and the R8 rule that strips from release builds. The companion CI capture-on-failure pattern lives in .
adb logcatLog.d../../automation/scripting-adb-for-ci/SKILL.md此 skill 全面介绍 :包括流式读取与转储、缓冲区选择、过滤表达式、格式标志、PID 与时间过滤器、文件轮转,以及从发布构建中移除 的 R8 规则。配套的 CI 失败时采集模式位于 。
adb logcatLog.d../../automation/scripting-adb-for-ci/SKILL.mdWhen to use this skill
何时使用此 skill
- A test fails on CI; the developer needs to dump the device log into the artefact archive.
- The developer's is overwhelming the SSH session — the logcat-side filter is the fix.
adb logcat | grep MyApp - A scenario only reproduces inside or
system_serverbuffers, not the defaultcrash.main - The developer wants structured logs () for machine ingestion.
-v json - A call appears to leak in release — the R8
Log.d("Sensitive", "...")rule is missing.-assumenosideeffects - Logs disappear after the app is killed by Doze/ANR — plus a re-resolution loop is needed.
--pid
- CI 中测试失败;开发者需要将设备日志转储到制品归档中。
- 开发者的 淹没了 SSH 会话——解决方案是在 logcat 端进行过滤。
adb logcat | grep MyApp - 某个场景只能在 或
system_server缓冲区中复现,而不能在默认的crash缓冲区中复现。main - 开发者需要结构化日志()以供机器摄取。
-v json - 发布版本中出现了可能泄漏敏感信息的 调用——说明缺少 R8
Log.d("Sensitive", "...")规则。-assumenosideeffects - 应用被 Doze/ANR 终止后日志消失——需要使用 配合重新解析 PID 的循环。
--pid
When NOT to use this skill
何时不应使用此 skill
- Capturing a screenshot or video. Use .
../../capture/capturing-screenshots-and-screenrecord/SKILL.md - Pulling a generic file from the device. Use .
../../transfer/extracting-test-artifacts/SKILL.md - The whole script — retries, port forwarding, parallel device fan-out. Use .
../../automation/scripting-adb-for-ci/SKILL.md - Driving gestures or settings changes. Use .
../../control/injecting-input-and-state/SKILL.md
- 截取屏幕截图或视频。请使用 。
../../capture/capturing-screenshots-and-screenrecord/SKILL.md - 从设备中提取通用文件。请使用 。
../../transfer/extracting-test-artifacts/SKILL.md - 编写完整脚本——包括重试、端口转发和并行设备分发。请使用 。
../../automation/scripting-adb-for-ci/SKILL.md - 执行手势或更改设置。请使用 。
../../control/injecting-input-and-state/SKILL.md
Prerequisites
前置条件
- returns
adb get-state. Seedevice.../../devices/connecting-to-devices/SKILL.md - For : device API 30+ (Android 11+). Stack with
-v jsonfor unambiguous timestamps.-v UTC -v year - For per-PID filtering: requires API 24+ (toybox
adb shell pidof -s <pkg>); on older releases usepidof -s.adb shell ps -A | grep <pkg>
- 返回
adb get-state。请参阅device。../../devices/connecting-to-devices/SKILL.md - 对于 :设备 API 30+(Android 11+)。可结合
-v json使用,以获得无歧义的时间戳。-v UTC -v year - 对于按 PID 过滤:需要 API 24+(toybox
adb shell pidof -s <pkg>);在较旧版本上请使用pidof -s。adb shell ps -A | grep <pkg>
Three fundamental operations
三种基本操作
| Command | Behavior |
|---|---|
| Stream the device log to stdout; runs until interrupted. |
| "Dumps the log and exits." Snapshot mode — perfect for CI. |
| "Clears the log buffer." Run this before reproducing a bug. |
(Verbatim quotes from developer.android.com/tools/logcat.)
Idiomatic CI capture pattern:
bash
adb logcat -c # clear before scenario
./run-scenario.sh # reproduce
adb logcat -d > artifacts/log.txt # dump after| 命令 | 行为 |
|---|---|
| 将设备日志流式输出到 stdout;一直运行直到被中断。 |
| “转储日志并退出。”快照模式——非常适合 CI。 |
| “清空日志缓冲区。”在复现 bug 前运行此命令。 |
(引自 developer.android.com/tools/logcat。)
惯用的 CI 采集模式:
bash
adb logcat -c # clear before scenario
./run-scenario.sh # reproduce
adb logcat -d > artifacts/log.txt # dump afterBuffer selection
缓冲区选择
-b <name>| Buffer | What it contains |
|---|---|
| Default app-side buffer. Does NOT contain system/crash. |
| Framework / system_server messages. |
| Tombstones + unhandled-exception output. |
| Structured/binary system event buffer. Pair with |
| Radio/telephony related messages. |
| Kernel buffer. |
| Every buffer. |
| Implicit set: |
Multiple flags or comma-separated lists both work:
-bbash
adb logcat -b radio
adb logcat -b main -b radio -b events
adb logcat -b main,radio,eventsThe buffer is where to look for , , , — emitted by the framework for instrumentation, not for human reading. Decode tag names with:
eventsam_*wm_*input_focusnotification_*bash
adb logcat -b events -v descriptive-b <name>| 缓冲区 | 内容 |
|---|---|
| 默认的应用侧缓冲区。不包含 system/crash。 |
| Framework / system_server 消息。 |
| Tombstones 和未处理异常输出。 |
| 结构化/二进制系统事件缓冲区。配合 |
| 无线电/电话相关消息。 |
| Kernel 缓冲区。 |
| 所有缓冲区。 |
| 隐式集合: |
可以使用多个 标志,也可以使用逗号分隔的列表:
-bbash
adb logcat -b radio
adb logcat -b main -b radio -b events
adb logcat -b main,radio,eventseventsam_*wm_*input_focusnotification_*bash
adb logcat -b events -v descriptivePriority ladder + filter expressions
优先级阶梯与过滤表达式
Filter specs are space-separated pairs. matches every tag.
tag:priority*| Letter | Meaning |
|---|---|
| Verbose |
| Debug |
| Info |
| Warning |
| Error |
| Fatal |
| "Silent (highest priority, nothing is printed)" |
Setting silences everything, then any preceding re-enables that tag at priority or above. The canonical "show only my app's logs" idiom:
*:Stag:PPbash
adb logcat ActivityManager:I MyApp:D *:S"Suppress all logs except ActivityManager (Info+) and MyApp (Debug+)" — developer.android.com/tools/logcat.
Other staples:
bash
adb logcat *:W # warnings and above, all tags
adb logcat *:E # errors and above (very common in CI)zsh/bash will glob-expand outside of quotes when there is a file named in cwd — quote when scripting:
*:SSbash
adb logcat "ActivityManager:I MyApp:D *:S"The same filter can be the host default via env var:
bash
export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"过滤规格由空格分隔的 对组成。 匹配所有标签。
tag:priority*| 字母 | 含义 |
|---|---|
| Verbose |
| Debug |
| Info |
| Warning |
| Error |
| Fatal |
| “Silent(最高优先级,不打印任何内容)” |
设置 会静默所有内容,随后任意位于其前的 都会重新启用对应标签,并显示优先级 及以上的日志。显示“我的应用日志”的标准写法:
*:Stag:PPbash
adb logcat ActivityManager:I MyApp:D *:S“抑制除 ActivityManager(Info+)和 MyApp(Debug+)之外的所有日志”——developer.android.com/tools/logcat。
其他常用用法:
bash
adb logcat *:W # warnings and above, all tags
adb logcat *:E # errors and above (very common in CI)在 zsh/bash 中,如果当前目录存在名为 的文件,未加引号的 会被 glob 展开;编写脚本时应加引号:
S*:Sbash
adb logcat "ActivityManager:I MyApp:D *:S"也可以通过环境变量将同一个过滤器设置为主机端默认值:
bash
export ANDROID_LOG_TAGS="ActivityManager:I MyApp:D *:S"Format flags — -v <format>
-v <format>格式标志——-v <format>
-v <format>| Format | What you get |
|---|---|
| "Displays priority, tag, and PID" |
| "All metadata fields with blank lines between messages" |
| "PID only" |
| "Raw log message with no metadata" |
| "Priority and tag only" |
| "Legacy format showing priority, PID, and TID" |
| DEFAULT. "Date, time, priority, tag, PID, and TID" |
| "Date, time, priority, tag, and PID" |
Format modifiers stack with (comma-combinable or repeatable):
-v| Modifier | Effect |
|---|---|
| Per-priority colour. |
| Decode event log tag names. |
| Time in seconds since 1970-01-01. |
| CPU seconds from last boot. |
| Escape binary content. |
| UID or Android ID of logged process. |
| Time with microsecond precision. |
| Time as UTC. |
| Add year to displayed time. |
| Add local time zone. |
bash
adb logcat -v json -v UTC -v year # Android 11+; structured stream, unambiguous time
adb logcat -b all -v color -d # color dump, all buffersDefault-line example (developer.android.com/tools/logcat):
I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action.MAIN ... }Schema for : . adds date/time/TID.
brief<priority>/<tag>(<PID>): <message>threadtime| 格式 | 输出内容 |
|---|---|
| “显示优先级、标签和 PID” |
| “显示所有元数据字段,并在消息之间留空行” |
| “仅 PID” |
| “原始日志消息,不含元数据” |
| “仅优先级和标签” |
| “旧版格式,显示优先级、PID 和 TID” |
| 默认值。“日期、时间、优先级、标签、PID 和 TID” |
| “日期、时间、优先级、标签和 PID” |
格式修饰符可与 叠加使用(可通过逗号组合或重复指定):
-v| 修饰符 | 效果 |
|---|---|
| 按优先级着色。 |
| 解码事件日志标签名称。 |
| 距离 1970-01-01 的秒数。 |
| 自上次启动以来的 CPU 秒数。 |
| 转义二进制内容。 |
| 记录进程的 UID 或 Android ID。 |
| 精确到微秒的时间。 |
| UTC 时间。 |
| 在显示时间中加入年份。 |
| 加入本地时区。 |
bash
adb logcat -v json -v UTC -v year # Android 11+; structured stream, unambiguous time
adb logcat -b all -v color -d # color dump, all buffers默认行示例(developer.android.com/tools/logcat):
I/ActivityManager( 585): Starting activity: Intent { action=android.intent.action.MAIN ... }brief<priority>/<tag>(<PID>): <message>threadtimeTime and PID filters
时间与 PID 过滤器
- — start at the first entry on or after the given timestamp. Format matches
-T '<date> <time>', e.g.threadtime.'01-01 12:00:00.000' - — print the last N entries from the buffer, then continue streaming.
-T <count> - — print the last N entries, then exit (i.e.
-t <count>is-twith auto-quit).-T - — emit only entries from a single process. Combine with
--pid <pid>:pidof
bash
adb logcat --pid=$(adb shell pidof -s com.example.app)pidof -s-s--pidbash
while true; do
PID=$(adb shell pidof -s com.example.app 2>/dev/null)
[ -n "$PID" ] && adb logcat --pid="$PID"
sleep 1
done- ——从给定时间戳或之后的第一个条目开始输出。格式与
-T '<date> <time>'匹配,例如threadtime。'01-01 12:00:00.000' - ——打印缓冲区中的最后 N 个条目,然后继续流式输出。
-T <count> - ——打印最后 N 个条目,然后退出(即
-t <count>是带自动退出功能的-t)。-T - ——仅输出单个进程的条目。可结合
--pid <pid>使用:pidof
bash
adb logcat --pid=$(adb shell pidof -s com.example.app)pidof -s-s--pidbash
while true; do
PID=$(adb shell pidof -s com.example.app 2>/dev/null)
[ -n "$PID" ] && adb logcat --pid="$PID"
sleep 1
doneBuffer rotation and persistence
缓冲区轮转与持久化
For long captures, persist to a file with rotation:
| Flag | Meaning |
|---|---|
| Write to |
| Rotate output every N kilobytes. Requires |
| Keep at most |
| Resize the kernel log buffer for the selected |
| Print buffer sizes and current usages, then exit. Cheap diagnostics for "why am I missing logs?". |
bash
adb logcat -G 16M # grow the main buffer
adb logcat -g # inspect sizes
adb logcat -b main -f /data/local/tmp/app.log \
-r 1024 -n 8 # 8x ~1MB rotated files (device-side)
adb shell logcat -b main -f /data/local/tmp/app.log \
-r 1024 -n 8 # same, but the device runs itThe resize is global to that buffer and persists across restarts (until reboot). Don't set 16 MB on a memory-constrained device and forget — release memory back with after the suite if your CI farm is shared.
-Glogd-G 256K对于长时间采集,可通过轮转将日志持久化到文件:
| 标志 | 含义 |
|---|---|
| 写入 |
| 每 N KB 轮转一次输出。需要与 |
| 最多保留 |
| 调整所选 |
| 打印缓冲区大小和当前使用量,然后退出。适合低成本诊断“为什么缺少日志?”等问题。 |
bash
adb logcat -G 16M # grow the main buffer
adb logcat -g # inspect sizes
adb logcat -b main -f /data/local/tmp/app.log \
-r 1024 -n 8 # 8x ~1MB rotated files (device-side)
adb shell logcat -b main -f /data/local/tmp/app.log \
-r 1024 -n 8 # same, but the device runs it-Glogd-G 256KStripping Log.d
in release — R8 rule
Log.d在发布版本中移除 Log.d
——R8 规则
Log.dandroid.util.Logproguard-rules.propro
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** d(...);
public static *** i(...);
public static boolean isLoggable(java.lang.String, int);
}-assumenosideeffectswewtfBuildConfig.DEBUGDebugTreeReleaseTreeFor Compose specifically, do not — it removes null-checks the compiler relies on.
-assumenosideeffectskotlin.jvm.internal.Intrinsics除非代码裁剪将其移除,否则 调用会保留在发布 APK 中。 中的标准写法(R8/ProGuard):
android.util.Logproguard-rules.propro
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** d(...);
public static *** i(...);
public static boolean isLoggable(java.lang.String, int);
}-assumenosideeffectswewtfBuildConfig.DEBUGDebugTreeReleaseTree对于 Compose specifically,不要对 使用 ——这会移除编译器所依赖的空值检查。
kotlin.jvm.internal.Intrinsics-assumenosideeffectsPatterns
模式
Pattern: WRONG — adb logcat | grep MyApp
for filtering
adb logcat | grep MyApp模式:错误——使用 adb logcat | grep MyApp
进行过滤
adb logcat | grep MyAppbash
undefinedbash
undefinedWRONG
WRONG
adb logcat | grep MyApp
adb logcat | grep MyApp
WRONG because: the device sends every log line over the USB/TCP transport, then the host
WRONG because: the device sends every log line over the USB/TCP transport, then the host
discards 99% via grep. On a busy device this saturates the transport and the grep can lag
discards 99% via grep. On a busy device this saturates the transport and the grep can lag
behind real time. Worse, grep
runs without -F, so a tag that contains regex metacharacters
grepbehind real time. Worse, grep
runs without -F, so a tag that contains regex metacharacters
grep(.
, (
, +
) silently mismatches.
.(+(.
, (
, +
) silently mismatches.
.(+
```bash
```bashRIGHT — filter at the logcat level
RIGHT — filter at the logcat level
adb logcat MyApp:D *:S
The device only emits matching lines; the transport is uncongested.adb logcat MyApp:D *:S
设备只会输出匹配的行,因此传输通道不会拥塞。Pattern: WRONG — assuming -T <count>
exits
-T <count>模式:错误——误以为 -T <count>
会退出
-T <count>bash
undefinedbash
undefinedWRONG
WRONG
adb logcat -T 100 > tail.txt
adb logcat -T 100 > tail.txt
Hangs forever — -T <count> prints the last 100 lines THEN CONTINUES STREAMING.
Hangs forever — -T <count> prints the last 100 lines THEN CONTINUES STREAMING.
```bash
```bashRIGHT — -t
is -T
with auto-exit
-t-TRIGHT — -t
is -T
with auto-exit
-t-Tadb logcat -t 100 > tail.txt
undefinedadb logcat -t 100 > tail.txt
undefinedPattern: structured logs for machine ingestion
模式:用于机器摄取的结构化日志
bash
adb logcat -v json -v UTC -v year -d -b all > run.jsonlEach line is a single JSON object — pipe through :
jqbash
jq -c 'select(.priority == "ERROR")' run.jsonl( requires Android 11+ on the device.)
-v jsonbash
adb logcat -v json -v UTC -v year -d -b all > run.jsonl每一行都是一个独立的 JSON 对象——可通过 进行管道处理:
jqbash
jq -c 'select(.priority == "ERROR")' run.jsonl( 要求设备运行 Android 11+。)
-v jsonPattern: capture-on-failure — clear, run, dump
模式:失败时采集——清空、运行、转储
bash
adb logcat -c
./run-scenario.sh
RC=$?
if [ "$RC" -ne 0 ]; then
adb logcat -d -v threadtime > artifacts/logcat.txt
adb logcat -d -b crash -v threadtime > artifacts/crash.txt
adb logcat -d -b events -v descriptive > artifacts/events.txt
fi
exit "$RC"-cbash
adb logcat -c
./run-scenario.sh
RC=$?
if [ "$RC" -ne 0 ]; then
adb logcat -d -v threadtime > artifacts/logcat.txt
adb logcat -d -b crash -v threadtime > artifacts/crash.txt
adb logcat -d -b events -v descriptive > artifacts/events.txt
fi
exit "$RC"-cPattern: PID-bound stream that survives a process restart
模式:可承受进程重启的 PID 绑定流
bash
while true; do
PID=$(adb shell pidof -s com.example.app 2>/dev/null)
if [ -n "$PID" ]; then
adb logcat --pid="$PID" -v threadtime
fi
sleep 1
doneThe outer loop re-resolves the PID after Doze/ANR/crash kills and restarts the app.
bash
while true; do
PID=$(adb shell pidof -s com.example.app 2>/dev/null)
if [ -n "$PID" ]; then
adb logcat --pid="$PID" -v threadtime
fi
sleep 1
done外层循环会在 Doze/ANR/crash 终止并重启应用后重新解析 PID。
Pattern: -f
host vs device side
-f模式:-f
的主机端与设备端差异
-fbash
undefinedbash
undefinedhost-side rotation (file lives on the developer machine)
host-side rotation (file lives on the developer machine)
adb logcat -b main -f ~/logs/app.log -r 1024 -n 8
adb logcat -b main -f ~/logs/app.log -r 1024 -n 8
device-side rotation (file lives in /data/local/tmp on the device)
device-side rotation (file lives in /data/local/tmp on the device)
adb shell logcat -b main -f /data/local/tmp/app.log -r 1024 -n 8
adb pull /data/local/tmp/app.log ~/logs/app.log # later
undefinedadb shell logcat -b main -f /data/local/tmp/app.log -r 1024 -n 8
adb pull /data/local/tmp/app.log ~/logs/app.log # later
undefinedMandatory rules
强制规则
- MUST filter at the logcat level (e.g. ), not via host-side
MyApp:D *:S. Filtering on the device avoids saturating the transport.grep - MUST quote filter strings containing in zsh/bash (e.g.
*) — globbing eats the asterisk if a file named"MyApp:D *:S"exists in cwd.S - MUST use for "tail and exit".
-t <count>continues streaming after the initial dump.-T <count> - MUST use for snapshot dumps in CI. Streaming
-drequires explicit termination.adb logcat - MUST call before reproducing a bug whose log dump you want to attach. Otherwise the dump includes irrelevant prior history.
adb logcat -c - MUST distinguish (host-side path) from
adb logcat -f <file>(device-side path). The shell forms diverge.adb shell logcat -f <file> - MUST add the R8 rule for
-assumenosideeffectsandroid.util.Log/v/d(andi) when shipping release APKs that previously calledisLoggablewith sensitive data. KeepLog.d/w/e.wtf - MUST NOT
-assumenosideeffects— that removes null-check semantics the Kotlin compiler relies on.kotlin.jvm.internal.Intrinsics - MUST NOT rely on on devices below Android 11 — silently emits an empty stream.
-v json - PREFERRED: stack (or
-v threadtime,year,UTC) for unambiguous absolute timestamps in CI artefacts.-v threadtime -v year -v UTC - PREFERRED: run with for the
-G 16Mbuffer when capturing slow-burning bugs, and reset to default in teardown.main
- 必须在 logcat 层进行过滤(例如 ),而不是使用主机端的
MyApp:D *:S。在设备端过滤可避免传输通道饱和。grep - 必须在 zsh/bash 中为包含 的过滤字符串加引号(例如
*)——如果当前目录存在名为"MyApp:D *:S"的文件,glob 会吞掉星号。S - 必须使用 实现“输出尾部内容后退出”。
-t <count>会在初始转储后继续流式输出。-T <count> - 必须在 CI 中使用 执行快照转储。流式的
-d需要显式终止。adb logcat - 必须在复现需要附加日志转储的 bug 前调用 。否则转储中会包含无关的历史日志。
adb logcat -c - 必须区分 (主机端路径)与
adb logcat -f <file>(设备端路径)。这两种 shell 形式存在差异。adb shell logcat -f <file> - 必须为此前使用 处理敏感数据的发布 APK 添加 R8
Log.d规则,以移除-assumenosideeffects的android.util.Log/v/d(以及i)。保留isLoggable/w/e。wtf - 禁止对 使用
kotlin.jvm.internal.Intrinsics——这会移除 Kotlin 编译器依赖的空值检查语义。-assumenosideeffects - 禁止依赖 Android 11 以下设备上的 ——它会静默输出空流。
-v json - **推荐:**叠加使用 (或
-v threadtime,year,UTC),为 CI 制品提供无歧义的绝对时间戳。-v threadtime -v year -v UTC - **推荐:**采集缓慢出现的 bug 时,对 缓冲区使用
main,并在清理阶段恢复默认值。-G 16M
Verification
验证
- No script in or
scripts/pipes.github/workflows/directly intoadb logcatfor filtering. All filters are passed as logcat args.grep - CI capture-on-failure dumps include at least ,
main, andcrashbuffers.events - Release APKs do not emit calls (verify via
Log.dreturning onlyapkanalyzer dex packages app-release.apk | grep 'android.util.Log'/e/w).wtf - Filter strings containing in shell scripts are quoted.
*:S - All invocations use
--pid(singular) and re-resolve in a loop if the app may restart.pidof -s <pkg> - Every long-running session in CI has a wall-clock budget (
adb logcat) so a stuck session doesn't fill the disk.timeout 600s adb logcat ...
- 或
scripts/中没有脚本将.github/workflows/直接管道传给adb logcat进行过滤。所有过滤器都应作为 logcat 参数传入。grep - CI 失败时采集的转储至少包含 、
main和crash缓冲区。events - 发布 APK 不输出 调用(可通过
Log.d进行验证,结果应仅包含apkanalyzer dex packages app-release.apk | grep 'android.util.Log'/e/w)。wtf - Shell 脚本中包含 的过滤字符串均已加引号。
*:S - 所有 调用均使用
--pid(单数),并在应用可能重启时通过循环重新解析。pidof -s <pkg> - CI 中每个长时间运行的 会话都设有挂钟时间预算(
adb logcat),避免卡住的会话占满磁盘。timeout 600s adb logcat ...
References
参考资料
- developer.android.com/tools/logcat — buffer table, priority ladder, filter expressions, /
-v threadtime/json, format modifiers,descriptive/-T/-t/--pid/-r/-n/-Gflags, line-format schema.-g - developer.android.com/tools/adb — host-side shorthand vs
adb logcat.adb shell logcat - developer.android.com/studio/build/shrink-code — R8 and the
-assumenosideeffectsstrip rule.android.util.Log - developer.android.com/reference/android/util/Log — /
Log.v/d/i/w/e/wtfsignatures.isLoggable - Research note — full logcat surface,
tasks/research/A3-adb-observability-automation.mdhost-vs-device subtlety, R8 keep-rule rationale, capture-on-failure CI pattern.-f - Sibling skill: — server / daemon, transport.
../../architecture/understanding-adb-architecture/SKILL.md - Sibling skill: — device states,
../../devices/connecting-to-devices/SKILL.md.wait-for-device - Sibling skill: —
../../devices/connecting-over-wifi/SKILL.md/adb pair.adb connect - Sibling skill: — installing the APK whose logs are being captured.
../../apps/installing-and-managing-apps/SKILL.md - Sibling skill: —
../../tests/running-instrumented-tests-via-adb/SKILL.mdinterplay with logcat.am instrument -w -r - Sibling skill: — driving gestures whose effects show up in logcat.
../../control/injecting-input-and-state/SKILL.md - Sibling skill: — companion screenshot capture.
../../capture/capturing-screenshots-and-screenrecord/SKILL.md - Sibling skill: — pulling rotated log files from the device.
../../transfer/extracting-test-artifacts/SKILL.md - Sibling skill: — full CI capture-on-failure / retry / cleanup patterns.
../../automation/scripting-adb-for-ci/SKILL.md - Cross-set: — instrumentation logs interleaved with logcat.
../../../instrumentation/runner/running-instrumented-tests-with-androidjunit4/SKILL.md - Cross-set: — Activity lifecycle events surfaced in
../../../instrumentation/scenarios/launching-activities-with-activityscenario/SKILL.mdbuffer.events - Cross-set: — when log capture is the appropriate observability layer.
../../../fundamentals/strategies/applying-testing-strategies/SKILL.md
- developer.android.com/tools/logcat——缓冲区表、优先级阶梯、过滤表达式、/
-v threadtime/json、格式修饰符、descriptive/-T/-t/--pid/-r/-n/-G标志以及行格式模式。-g - developer.android.com/tools/adb——主机端简写与
adb logcat的区别。adb shell logcat - developer.android.com/studio/build/shrink-code——R8 与
-assumenosideeffects移除规则。android.util.Log - developer.android.com/reference/android/util/Log——/
Log.v/d/i/w/e/wtf方法签名。isLoggable - 研究笔记 ——完整的 logcat 功能面、
tasks/research/A3-adb-observability-automation.md主机端与设备端的细微差异、R8 keep-rule 原理以及 CI 失败时采集模式。-f - 关联 skill:——server / daemon 与传输机制。
../../architecture/understanding-adb-architecture/SKILL.md - 关联 skill:——设备状态与
../../devices/connecting-to-devices/SKILL.md。wait-for-device - 关联 skill:——
../../devices/connecting-over-wifi/SKILL.md/adb pair。adb connect - 关联 skill:——安装待采集日志的 APK。
../../apps/installing-and-managing-apps/SKILL.md - 关联 skill:——
../../tests/running-instrumented-tests-via-adb/SKILL.md与 logcat 的交互。am instrument -w -r - 关联 skill:——执行会在 logcat 中体现结果的手势。
../../control/injecting-input-and-state/SKILL.md - 关联 skill:——配套的截图采集。
../../capture/capturing-screenshots-and-screenrecord/SKILL.md - 关联 skill:——提取轮转后的日志文件。
../../transfer/extracting-test-artifacts/SKILL.md - 关联 skill:——完整的 CI 失败时采集、重试与清理模式。
../../automation/scripting-adb-for-ci/SKILL.md - 跨集合:——与 logcat 交织的 instrumentation 日志。
../../../instrumentation/runner/running-instrumented-tests-with-androidjunit4/SKILL.md - 跨集合:——在
../../../instrumentation/scenarios/launching-activities-with-activityscenario/SKILL.md缓冲区中呈现的 Activity 生命周期事件。events - 跨集合:——何时日志采集是合适的可观测性层。
../../../fundamentals/strategies/applying-testing-strategies/SKILL.md