lynx-trace-record
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese1. Workflow Example
1. 工作流示例
The recording process requires using the CLI tool. The order of operations is critical.
trace_record录制过程需要使用 CLI工具。操作顺序至关重要。
trace_recordStep 1. List connected clients:
步骤1. 列出已连接的客户端:
First, list all connected clients to get the client ID. This helps you identify which app to trace.
- If you have multiple connected clients, ask the user to specify the client ID you want to trace. Then, use this ID with the parameter to trace.
--client - If you have only one connected client, you can omit the parameter.
--client - If no clients are found, prompt the user to connect their device via USB and open the debugging app.
bash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs list-clients
首先,列出所有已连接的客户端以获取客户端ID。这有助于你确定要追踪的应用。
- 如果有多个已连接的客户端,请让用户指定要追踪的客户端ID。然后,将此ID与参数一起使用进行追踪。
--client - 如果只有一个已连接的客户端,可以省略参数。
--client - 如果未找到任何客户端,请提示用户通过USB连接设备并打开调试应用。
bash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs list-clients
Step 2. Start recording:
步骤2. 开始录制:
Execute the start command BEFORE building or opening the page on your device. This ensures you capture the entire first frame of the page. Use the parameter with the client ID from Step 1.
--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs start --client <client-id>在设备上构建或打开页面之前执行启动命令。这样可以确保捕获页面的整个第一帧。使用步骤1中获取的客户端ID搭配参数。
--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs start --client <client-id>Step 3. Build and Open the Page
步骤3. 构建并打开页面
Start your development server. If it does not auto-open the page, manually open the target page.
bash
pnpm run dev启动开发服务器。如果服务器未自动打开页面,请手动打开目标页面。
bash
pnpm run devStep 4. Perform Actions
步骤4. 执行操作
If you are debugging interactions (e.g., scrolling, clicking, data updates), perform those actions on the device now.
如果正在调试交互操作(例如滚动、点击、数据更新),请现在在设备上执行这些操作。
Step 5. Stop Recording & Get Stream Handle
步骤5. 停止录制并获取流句柄
Stop the trace recording. The CLI will output a JSON response containing a field (this is your stream handle). Use the parameter with the same client ID from Step 1.
stream--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs end --client <client-id>停止追踪录制。CLI会输出包含字段的JSON响应(这就是你的流句柄)。使用与步骤1相同的客户端ID搭配参数。
stream--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs end --client <client-id>Step 6. Read and Save Trace Data
步骤6. 读取并保存追踪数据
Use the stream handle obtained from Step 5 to download and save the trace file to your local machine. Use the parameter with the same client ID from Step 1.
--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs readData --client <client-id> --stream <stream-handle> --output ./my-trace.pftrace使用步骤5中获取的流句柄下载追踪文件并保存到本地机器。使用与步骤1相同的客户端ID搭配参数。
--clientbash
node <path_to_the_skill>/scripts/trace_record.bundle.cjs readData --client <client-id> --stream <stream-handle> --output ./my-trace.pftrace2. Troubleshooting Common Errors
2. 常见错误排查
"Please restart the app to enable tracing functionality"
"请重启应用以启用追踪功能"
enable_debug_modeenable_debug_mode"Tracing functionality is not supported in the current version"
"当前版本不支持追踪功能"
Make sure you're using the Lynx development version. For more information, visit: https://lynxjs.org/guide/start/integrate-lynx-dev-version.html
请确保你使用的是Lynx开发版本。如需更多信息,请访问:https://lynxjs.org/guide/start/integrate-lynx-dev-version.html
"Tracing is not started, please start tracing first"
"未开始追踪,请先启动追踪"
You need to run before running and .
startendreadData你需要先运行命令,再运行和命令。
startendreadData