JPEG Screenshots

Configure Cordova/Capacitor session JPEG capture and manual native screen-frame capture.

const options = Ansight.createOptionsBuilder()
  .withSessionJpegCapture({
    intervalMilliseconds: 2000,
    quality: 60,
    maxWidth: 480,
    mode: "screenshotAndVisualTree",
    captureKeyboardPresence: true,
  })
  .build();

Capture one frame:

await Ansight.captureScreenFrame({
  quality: 70,
  maxWidth: 720,
});

Screenshots use the native Android/iOS implementation and include the rendered WebView. Studio may use host-side capture for a simulator or emulator; a physical iPhone or iPad uses in-app capture. Disable periodic capture for performance-focused runs.

Visual-Tree and Keyboard Metadata

mode accepts "screenshotOnly" (the default), "screenshotAndVisualTree", or "screenshotWithVisualTreeOnTouch". Screenshot-aligned mode captures registered native or DOM sources with each app-owned frame. Touch mode captures trees on touch down and touch up; move and cancel events do not trigger a tree.

Tree capture requires a registered visual-tree provider, and touch-triggered mode requires touch capture. Payloads follow the compact visual-tree v2 contract.

captureKeyboardPresence defaults to false and records only whether the native on-screen keyboard was present. It never records keyboard contents or dimensions and remains useful when Studio owns simulator/emulator screenshots.