自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
捕获跟踪记录
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
您可以通过 Winscope 或 Android 调试桥 (adb) 命令在设备上捕获跟踪记录。
在 Winscope 中,您可以检索在上一个会话期间从设备收集的最新跟踪记录。当遇到连接问题(例如使用 ADB over Wi-Fi)或 Winscope 意外关闭时,此功能特别有用。如果上一个会话没有跟踪记录,Winscope 会显示未找到有效的跟踪记录文件。
错误消息
Winscope 会在跟踪记录收集期间显示以下消息:
消息 |
说明 |
未选择任何跟踪目标 |
未选中任何跟踪复选框。 |
跟踪过程中出现错误:
错误:INVALID_LAYER_STACK ,请检查您的显示状态(跟踪开始时必须处于开启状态) |
请求了屏幕录制,但在跟踪开始时屏幕已关闭。 |
跟踪过程中出现错误:
从 adb 命令收到特定错误消息,例如“Failed to find valid files for <trace types requested>” |
adb 无法读取跟踪文件,这通常发生在 adb 未以 root 身份运行时。 |
跟踪过程中出现错误:
跟踪超时 |
设备存在连接问题。 |
跟踪过程中出现错误:{inner error} |
此消息涵盖所有其他错误。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-25。
[null,null,["最后更新时间 (UTC):2025-02-25。"],[],[],null,["# Capture traces\n\nYou can capture traces on the\n[device](/docs/core/graphics/winscope/capture/on-device),\nthrough\n[Winscope](/docs/core/graphics/winscope/capture/winscope),\nor through\n[Android Debug Bridge (adb)](/docs/core/graphics/winscope/capture/adb)\ncommands.\n\nIn Winscope, you can retrieve the latest traces collected from a device during\nthe previous session. This feature is especially helpful when facing connection\nissues, such as using ADB over Wi-Fi, or when Winscope closes unexpectedly. If\nthere are no traces from the last session, Winscope displays **No valid trace\nfiles found**.\n\nError messages\n--------------\n\nWinscope shows the following messages during trace collection:\n\n| Message | Description |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------|\n| No trace targets selected | No trace checkboxes are selected. |\n| Errors occurred during tracing: ERROR: `INVALID_LAYER_STACK`, please check your display state (must be on at start of trace) | A screen recording was requested, but the display was off at the start of trace. |\n| Errors occurred during tracing: A specific error message received from adb command, such as Failed to find valid files for *\\\u003ctrace types requested\\\u003e* | adb couldn't read the trace files, which typically happens when adb isn't running as root. |\n| Errors occurred during tracing: *Tracing time out* | There's a connection issue with the device. |\n| Errors occurred during tracing: *{inner error}* | This message covers all other errors. |"]]