Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The best way to automate Android screenshots depends on what you need to automate. To capture a connected phone or emulator from a computer, use Android Studio’s android screen capture command or ADB’s screencap. To capture screens as part of repeatable app tests, use UI Automator and, where visual changes are the concern, screenshot tests. Android’s screenshot detection API is different: it reports certain user screenshot actions but does not capture an image for your app.

Choose the workflow that matches the job

What you want Use Where it runs
Save the current display of a connected phone or emulator android screen capture or ADB screencap Computer command line, targeting a connected device or emulator
Open screens and capture them as part of a repeatable UI flow UI Automator Automated Android UI test
Check whether the rendered interface changed Screenshot tests, usually alongside UI tests Test workflow comparing captures with approved images
React when a user takes a supported hardware-button screenshot Android screenshot detection API App callback; it does not provide the captured image

These methods differ in trigger, target, and purpose. A command captures what is on screen now; a UI test can navigate to a state and capture it; a screenshot test checks visual output; detection tells an app about a qualifying user action. Pick the method before writing automation so you do not build a test around an API that cannot perform the required job.

Capture a connected phone or emulator from your computer

Android documents two command-line approaches. The Android Studio CLI can save a PNG directly, while ADB can either save the file on the device and retrieve it or stream the PNG to the computer. Both approaches are suited to scripts that control an already connected device or emulator.

Option 1: Android Studio CLI

Run the documented command from a terminal where the Android command-line tool is available and the target device or emulator is connected:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Samsung Galaxy A16 4G LTE (128GB + 4GB) International Model SM-A165F/DS Factory Unlocked, 6.7", Dual SIM, 50MP Triple Camera (Case Bundle), Black
  • Please note, this device does not support E-SIM; This 4G model is compatible with all GSM networks worldwide outside of the U.S. In the US, ONLY compatible with T-Mobile and their MVNO's (Metro and Standup). It will NOT work with other CDMA carriers, and it is also not compatible with their MVNO (Visible, Xfinity Mobile, US Mobile, Cricket Wireless, etc).
  • Compatibility with certain third-party devices and accessibility accessories, including some hearing aids, may vary depending on manufacturer support, Bluetooth protocols, software compatibility, and regional firmware limitations. For additional hearing aid compatibility information, please refer to Samsung’s official support documentation.
  • Camera: 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, AF | 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, AF | 2 MP, f/2.4, (macro). Battery: 5000 mAh, non-removable | A power adapter is NOT included.
android screen capture --output=ui.png

The output is a PNG file named ui.png. The command can also annotate visible UI elements with numbered bounding boxes, which can help a later script or an agent identify controls. Check the current Android Studio CLI documentation for the supported annotation options and current command syntax before incorporating them into a long-lived script.

Option 2: ADB, saving on the device and pulling the file

ADB’s screencap utility can write a PNG to device storage. Then use adb pull to copy it to the computer:

adb shell screencap /sdcard/screen.png
adb pull /sdcard/screen.png

This separates capture from retrieval, which can be useful if another step needs the image to remain on the device. The local file is saved in the command’s current directory unless you specify a different destination for adb pull.

Option 3: ADB, streaming directly to the computer

For a shell script that only needs a local image, Android also documents streaming PNG output directly to a file on the computer:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Samsung Galaxy A17 5G Smart Phone 128GB US 1 Yr Manufacturer Warranty Black
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.
adb exec-out screencap -p > screen.png

This avoids creating a persistent intermediate file on the device. The command’s output redirection is performed by your computer’s shell, so run it in a terminal or script on the computer, not inside an Android shell.

Connecting a physical device

A wired ADB setup requires a compatible data connection and an authorized device. A USB-C data cable is relevant only if the phone has a compatible port and you choose a wired connection; an emulator needs no cable, and wireless ADB can also be used when configured. The Android guidance cited here does not specify a required cable type. If the computer does not see the device, check the connection and ADB device authorization before troubleshooting the capture command itself.

Automate screenshots inside repeatable app tests

When the screenshot must follow a particular sequence—launching an app, navigating between screens, or interacting across apps—a one-shot shell capture is not enough. Android UI Automator is designed for automated UI interaction and can capture the full screen, an individual window, or an element during a test flow.

Use UI Automator for interaction and capture

UI Automator’s current guide describes a Kotlin-friendly API with explicit waiting and state management, useful when the UI appears asynchronously. A robust test should wait for the state it needs rather than assume a screen has finished rendering after a fixed pause. Then capture the required scope: the whole screen for an end-to-end visual record, or a window or element when that is the intended subject.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Tracfone Motorola Moto G 2025, 64GB, Saphire Blue (Locked to
  • Carrier: This phone is locked to Tracfone, which means this device can only be used on the Tracfone wireless network. Tracfone plan required, activating is easy, just 3 steps.
  • DISPLAY: Immersive viewing on a 6.7-inch super-bright 120Hz display with powerful stereo speakers and Bass Boost for cinematic entertainment.
  • CAMERA SYSTEM: Advanced 50MP Quad Pixel camera captures sharp, detailed photos and videos in any lighting condition
  • PERFORMANCE: Lightning-fast 5G connectivity paired with a powerful processor and RAM Boost for smooth multitasking.
  • BATTERY LIFE: Long-lasting 5000mAh battery with TurboPower charging technology delivers hours of power in minutes.

The UI Automator guide labels version 2.4 as under development. Verify the current release status and compatibility with your project before adopting examples from that guide, especially if your build depends on a stable test API. Avoid treating an in-development API as a guaranteed drop-in replacement for an established test setup.

Separate functional tests from screenshot tests

A UI test asks whether an interaction works and the app responds as expected. A screenshot test asks whether the rendered output differs from a previously approved image. These checks can complement one another: a functional test can catch a broken action even if the screen looks similar, while a visual comparison can catch an unintended layout or rendering change that a behavior assertion does not cover.

For repeatable visual checks, capture the same intended state under consistent conditions and compare it with the approved reference used by your workflow. Treat a visual difference as a signal to inspect, not automatically as proof of a defect: the test still needs to distinguish meaningful UI changes from expected rendering variation.

Can Android detect when someone takes a screenshot?

Android 14’s screenshot detection API lets an app register per-activity callbacks for a supported hardware-button screenshot action. The callback notifies the app that the qualifying action occurred; it does not hand the screenshot image to the app.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung Galaxy A17 5G Smart Phone 128GB, US 1 Yr Manufacturer Warranty Blue
  • YOUR CONTENT, SUPER SMOOTH: The ultra-clear 6.7" FHD+ Super AMOLED display of Galaxy A17 5G helps bring your content to life, whether you're scrolling through recipes or video chatting with loved ones.¹
  • LIVE FAST. CHARGE FASTER: Focus more on the moment and less on your battery percentage with Galaxy A17 5G. Super Fast Charging powers up your battery so you can get back to life sooner.²
  • MEMORIES MADE PICTURE PERFECT: Capture every angle in stunning clarity, from wide family photos to close-ups of friends, with the triple-lens camera on Galaxy A17 5G.
  • NEED MORE STORAGE? WE HAVE YOU COVERED: With an improved 2TB of expandable storage, Galaxy A17 5G makes it easy to keep cherished photos, videos and important files readily accessible whenever you need them.³
  • BUILT TO LAST: With an improved IP54 rating, Galaxy A17 5G is even more durable than before.⁴ It’s built to resist splashes and dust and comes with a stronger yet slimmer Gorilla Glass Victus front and Glass Fiber Reinforced Polymer back.

This is an awareness mechanism, not an automation mechanism. The documented API does not detect screenshots taken with ADB commands or instrumentation tests. If your goal is to save an image, use a capture command or test capture workflow instead.

What about monkeyrunner?

Android describes the legacy monkeyrunner tool as an API for controlling a device or emulator from outside Android code, but its documentation says the API is unmaintained and recommends UI Automator for new work. For a new screenshot workflow, do not choose monkeyrunner simply because an older script or tutorial uses it; prefer a maintained approach suited to the task.

Troubleshoot common failures

  • The command cannot find a device. Confirm the phone or emulator is connected and visible to the relevant Android tooling, and complete any device authorization prompt. A capture command cannot target a device that the computer has not made available.
  • The output file is missing. Check the command’s working directory and the exact output path. With adb shell screencap /sdcard/screen.png, the capture is on the device until you run adb pull; with adb exec-out screencap -p > screen.png, the local shell writes the file on the computer.
  • The PNG is not where expected after a pull. adb pull writes to the destination you specify, or the current directory if you omit one. Use an explicit local path if the next script step expects a particular location.
  • A test captures the wrong screen or an incomplete state. Make the test wait for the required UI state before capturing. UI Automator’s guidance emphasizes explicit waiting and state management; an arbitrary short delay can be insufficient when the interface loads asynchronously.
  • A screenshot test reports a visual difference. First determine whether the intended UI state was reached and whether the changed rendering is expected. A screenshot comparison establishes a difference from the approved image; it does not by itself explain the cause.
  • The app does not receive a screenshot detection callback. The Android 14 API described here covers a qualifying hardware-button action, not captures performed by ADB or instrumentation. Use capture tooling for those automated cases rather than expecting a detection callback.
  • An older automation tutorial recommends monkeyrunner. Android marks it unmaintained and recommends UI Automator for new work. Check the status of any legacy dependency before building a new workflow around it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

For a single capture, the direct CLI or ADB route has fewer moving parts than a UI test: it captures the connected target without first defining an interaction flow. A repeatable test takes more setup, but it can recreate the app state and tie the image to a test run. The choice is therefore about repeatability and test intent, not a documented speed ranking; the Android material cited here does not establish comparative timing or reliability figures.

For scripts that process many captures, decide how the file will be named, where it will be stored, and how failures will be reported. ADB’s direct stream is convenient when a local artifact is the goal; save-then-pull is useful when the device-side file is needed. In either case, make the script stop or report a failure when the capture step does not produce the expected artifact rather than silently passing an empty or stale file to later steps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Samsung Galaxy A16 5G 128GB Cell Phone, Unlocked Android Smartphone, Large AMOLED Display, Durable Design, Super Fast Charging, Expandable Storage, US Version, 2025, Blue Black (Renewed)
  • Charger NOT Included, 6.7" Super AMOLED FHD+, 90Hz Refresh Rate, 385 ppi, 800 nits (HBM), 1080x2340px, 5000mAh Battery
  • 128GB, 4GB RAM, microSDXC, Exynos 1330 (5nm), Octa-Core, Mali-G68 MP2 or Mali-G57 MC2 GPU
  • Rear Camera: 50MP, f/1.8 (wide) + 5MP, f/2.2 (ultrawide) + 2MP, f/2.4 (macro), LED flash, panorama, HDR; Front Camera: 13MP, f/2.0, Android 14, up to 6 major Android upgrades, One UI 6.1
  • 3G: HSDPA 850/900/1700(AWS)/1900/2100; 4G LTE: 1/2/3/4/5/7/12/13/14/20/25/26/28/29/30/38/39/40/41/48/66/71, 5G: 2/5/25/41/66/71/77/78 SA/NSA/Sub6/mmWave - Nano-SIM + eSIM
  • US Model – Global Connectivity – Compatible with Most GSM Carriers like T-Mobile, AT&T, MetroPCS, etc. Will Also work with CDMA Carriers Such as Verizon, Straight Talk.

No named cost figures are established for these Android capture commands or test workflows here. The practical choice is between the setup and maintenance appropriate to your environment: a command for direct capture, or a test framework when interaction and repeatability matter.

Or skip the browser setup

ScreenshotNeo is a website screenshot API, not a way to capture an Android device’s display. If the job is to capture a web page URL rather than a phone or emulator screen, one GET request can return an image or PDF. See the ScreenshotNeo documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

For website captures, ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before the shot; each cleanup step can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and response headers report the page verdict and billing status. Its MCP server provides screenshot and page-information tools for AI agents. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. These features apply to website screenshot requests, not Android device screenshots.

Sign up for ScreenshotNeo’s free plan to try website captures with 1,000 screenshots a month and no card.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Android documentation currency

Android command-line tools and API status can change. The guidance summarized here was checked against official Android Developers documentation on September 29, 2026; consult the current official documentation before relying on version-specific commands or adopting UI Automator 2.4, which its guide describes as under development.

Frequently Asked Questions

Can I schedule Android screenshots at a particular time?

The documented capture commands capture on invocation; this guidance does not specify an Android scheduling service. A computer-side scheduler can invoke a script that runs a capture command when the target device or emulator is available.

Can screenshot detection provide the image to my app?

No. The Android 14 detection callback reports a qualifying screenshot action but does not supply the screenshot image.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.