JPEG Screenshots
Configure React Native session JPEG capture and manual native frame capture.
React Native uses the native iOS and Android screenshot capture implementations.
Important: Screen capture will result in an FPS drop while native frames are captured, encoded, and transported. Use conservative interval, quality, and max-width settings, and disable
sessionJpegCapturefor performance-focused runs unless visual evidence is required.
Session Capture
Native all-in-one defaults enable JPEG capture every 2000 ms, quality 60, max width 480.
await Ansight.initializeAndActivate({
sessionJpegCapture: {
intervalMilliseconds: 2000,
quality: 60,
maxWidth: 480,
captureGpuBackedSurfaces: true,
},
});
Disable periodic capture:
await Ansight.initializeAndActivate({
sessionJpegCapture: false,
});
Manual Frame Capture
const result = await Ansight.captureScreenFrame({
quality: 60,
maxWidth: 480,
captureGpuBackedSurfaces: true,
});
A connected live session is required.
On iOS, captureGpuBackedSurfaces defaults to true so Metal, SceneKit, and
similar GPU-backed views are included. Set it to false to use a
lower-overhead capture path when those surfaces are not needed. Android accepts
the same option for cross-platform configuration parity.
On-Demand Tool
Register native VisualTree tools with withVisualTreeTools() to expose ui.get_screenshot. Screenshot bytes are delivered over the Ansight binary transfer protocol during live tool calls.