Take a screenshot
android_screenshotCapture the device screen as a PNG to confirm layout changes or inspect crashes, with optional file output.
Instructions
Capture the device screen as a PNG.
By default the image is returned inline so it can be looked at directly. Screenshots are large — a phone screen is typically 0.5–2 MB, and a tablet more — so when you only need the file (for a report, or to diff later), pass output_path and set include_image=false to keep it out of the conversation.
To read UI text or find something to tap, android_dump_ui is far cheaper than a screenshot and gives exact coordinates.
Args:
serial (string, optional): target device
output_path (string, optional): absolute path to also write the PNG to
include_image (boolean): return the image inline (default: true)
Returns: Inline image plus: { "bytes": number, "outputPath": string, "serial": string }
Examples:
Use when: confirming a layout change actually rendered as intended
Use when: the app crashed and you want to see what is on screen
Don't use when: you need the text of a view or somewhere to tap (use android_dump_ui)
Error Handling:
A black or empty image usually means a secure window (FLAG_SECURE) or a locked screen
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | No | Device serial from android_list_devices. Optional when exactly one device is connected; required when several are. | |
| output_path | No | Absolute path to write the PNG to, in addition to returning it. | |
| include_image | No | Return the image inline. Set false to only write it to output_path. |