Mobile Development 5 min read

Using minicap for Fast Android Screen Capture

This article introduces the minicap tool—a native NDK‑based screen‑capture solution for Android—explaining its advantages over the built‑in screencap command, how to compile or obtain binaries, install them on a device, and run it to obtain high‑speed, low‑size screenshots for automation testing.

360 Quality & Efficiency
360 Quality & Efficiency
360 Quality & Efficiency
Using minicap for Fast Android Screen Capture

During recent automation‑testing work I found the built‑in Android screencap command too slow, so I explored the classic tool minicap and would like to share my learning experience.

minicap is a dependency of the STF (Smartphone Test Farm) framework; it streams real‑time screen data from Android devices to a web client. The project has been actively maintained on GitHub for nearly three years, recently updated to support Android 8.1, and can achieve 30‑40 FPS on capable phones.

On a ZUK Z2 Pro device the native screencap takes more than 4 seconds to capture a screenshot, while minicap completes the same task in about 190 ms. minicap uses libjpeg‑turbo for compression, producing images around 100 KB at 1080p, compared with the 2 MB size of screencap output.

Installation: minicap is an NDK‑developed native tool consisting of an executable and a minicap.so library. Because minicap.so calls private APIs, it must be compiled against the AOSP source tree. You can compile it yourself or download pre‑built binaries from GitHub . No socket configuration is required for basic screenshot usage; for advanced setups see the official repository .

To push the binaries to the device, first determine the device’s ABI and SDK version:

adb shell getprop ro.product.cpu.abi | tr -d '\r'
adb shell getprop ro.build.version.sdk | tr -d '\r'

Then push the matching executable and library and make the executable runnable:

adb push libs/$ABI/minicap /data/local/tmp/
adb push jni/minicap-shared/aosp/libs/android-$SDK/$ABI/minicap.so /data/local/tmp/
chmod 777 /data/local/tmp/minicap

Running minicap:

adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/minicap -P 1080x1920@1080x1920/0 –t

If the command returns no error, the tool is installed correctly and ready to capture.

To save a screenshot and pull it back to the host you can use a simple Python script (shown in the original article) that invokes the above command, captures the output image, and pulls it via adb pull .

In summary, this guide outlines how to use minicap outside of STF, helping newcomers avoid common pitfalls and integrate fast screen capture into testing or development pipelines. A future article will dive deeper into the minicap source code and compare different screenshot solutions.

AndroidAutomation TestingNDKscreen-captureMinicap
360 Quality & Efficiency
Written by

360 Quality & Efficiency

360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.