On Android, it is usually possible to take a screenshot by pressing simultaneously the Volume Down
and Power
buttons. A shortcut can also be added to the menu that pops up when long-pressing the Power
button. Unfortunately this doesn't work out-of-the-box in Replicant because libagl, the software renderer used for SurfaceFlinger (screen compositor), has an incomplete OpenGL ES implementation.
It is possible to take screenshots from within Replicant by forcing SurfaceFlinger to use llvmpipe. Be aware that this will make your system extremely slow and bring in rendering issue to apps such as Gallery and Orbot.
On Replicant 6.0 0003 it is only possible to change the software renderer system-wide. Please follow the instructions at Graphics - Choosing the default software renderer.
As of Replicant 6.0 0004, llvmpipe is used as the default renderer. However, due to performance reasons, an exception is in place that forces SurfaceFlinger to use libagl instead. Follow these steps to remove the exception:
adb shell rm /system/etc/libGLES_android/system/bin/surfaceflinger
adb shell touch /system/etc/libGLES_android/system/bin/surfaceflinger
Regardless of which graphics renderer is enabled, it is possible to take screenshots when the device is connected to a computer through an USB cable. The following steps explain the procedure.
FFMEG="ffmpeg"
FFMEG="avconv"
./screencap.sh -f OUTPUT.PNG
OUTPUT.PNG
is the filename of the screenshot. The screenshot will be saved with this filename in the directory you are running the script in. The script only supports the PNG format for screenshots.The display size in pixels is auto-detected. If you want the script to be faster, you can add the screen size as another option, e.g.:
./screencap.sh -s 720x1280 -f OUTPUT.PNG
It is also possible to take screenshots in recovery mode with the script by running:
./screencap.sh -r -s SCREENSIZE -f OUTPUT.PNG