Skip to content

Diagnostics and Logging

星冉 edited this page Aug 24, 2026 · 2 revisions

Diagnostics and Logging

中文

Current surfaces

DiagnosticsViews.swift provides application diagnostics UI, while session/device managers produce runtime detail. The Makefile can follow the log for an application it launched with make logs. Diagnostic views, dependency checks, codec information, connection state, and safe user-facing errors must distinguish actionable UI summaries from raw technical detail.

Language and privacy rule

All application logs, helper diagnostics, protocol errors, and event/error details are English only, regardless of the selected UI language. User-facing labels and safe summaries are localized through Localizable.xcstrings. Do not present raw command lines, serials, tokens, or helper output as friendly UI copy unless the product intentionally exposes that information and it is safe to show.

Triage order

  1. Confirm the configured or discovered ADB executable and connection target.
  2. Check device discovery/preflight, authorization, selected address, and disconnect state.
  3. Check helper deployment/version and parse failures for management data.
  4. For native scrcpy, inspect server-asset checksum, push/forward/start result, required socket order, metadata, decoder/codec output, and cleanup.
  5. Record reproduction conditions and English technical detail before changing retry or timeout behavior.

Native video crash triage

An Xcode stop on EXC_BAD_ACCESS is not automatically a UI hang. Preserve the paused process long enough to inspect the failing thread and capture its complete stack. If the stack runs from the VideoToolbox callback through ScrcpyVideoSurface.publish, Core Image or MTLDebugTexture, and then agxaAssertBufferIsValid, treat frame publication and Metal texture readback as the primary suspect rather than ADB or socket startup.

The current implementation converts decoded CVPixelBuffer frames with VTCreateCGImageFromCVPixelBuffer; the removed CIContext.createCGImage route must not be reintroduced. See Native scrcpy Session for the media-path contract and regression checks.

Verification expectations

Exercise success, no-tool, timeout, cancellation, disconnect, malformed-data, and partial-data paths. A diagnostic change must not convert a protocol failure into a silent empty screen, and an error message shown to users must remain localized even when its saved technical detail is English.

Clone this wiki locally