Skip to main content
TapKit can capture high-resolution screenshots from your connected iPhone. Screenshots are returned as PNG image data.

Basic Usage

Return Value

The screenshot() method returns raw PNG bytes:

Working with Screenshots

Save to File

Display with PIL/Pillow

Use with OpenCV

Send to Vision API

Working with Vision Model Coordinates

Different vision models and APIs return coordinates in different formats. TapKit’s geometry utilities help you convert between them:

Converting Model Output

This makes it easy to integrate with any vision model regardless of its coordinate format.

Screenshot Loop

Capture screenshots at intervals:

Client-Level Screenshots

You can also capture via the client directly:

Performance Tips

Screenshots require a round-trip to the device. Capture only when needed rather than in a tight loop.
If doing heavy image processing, consider processing in a separate thread while capturing the next screenshot.
For real-time viewing, consider using TapKit’s WebRTC streaming instead of repeated screenshots.

Error Handling

Common errors:
  • Phone not connected
  • Mac app not running
  • Request timeout

Next Steps

Gestures

Learn about tap and swipe gestures

Geometry

Coordinate and bounding box utilities