Project

General

Profile

Screenshots » History » Version 7

doak complex, 01/23/2020 08:18 PM
Mention that 'llvmpipe' is needed for 'SurfaceFlinger' to take screenshots. Adapt formatting (names in italics).

1 1 Wolfgang Wiedmeyer
h1. Screenshots
2
3 7 doak complex
On Android, it is usually possible to take a screenshot by pressing the _Volume Down_ and _Power_ buttons. A shortcut can also be added to the menu that pops up when long-pressing the _Power_ button. These options only work on _Replicant_ when [[Graphics|llvmpipe is enabled as renderer]] for _SurfaceFlinger_ (the screen compositor). Be aware that there are issues with other apps like _Gallery_. Furthermore, there doesn't seem to exist an app in _F-Droid_ that makes it possible to take screenshots on _Replicant_ when _llvmpipe_ is not enabled.
4 1 Wolfgang Wiedmeyer
5
Regardless of which graphics renderer is enabled, it is possible to take screenshots when the device is connected to a PC with a USB cable. The following steps explain the procedure.
6
7
h2. Preparations
8 2 Wolfgang Wiedmeyer
9
Make sure [[ADB]] is running as root.
10
11 5 Wolfgang Wiedmeyer
Download this script: "screencap.sh":https://git.replicant.us/replicant/user-scripts/plain/screencap/screencap.sh
12 2 Wolfgang Wiedmeyer
13 7 doak complex
You need to have _ffmpeg_ installed. If _ffmpeg_ is not available on your _GNU/Linux_ system but _avconv_ is (e.g. as part of _libav-tools_), you will have to change the line
14 2 Wolfgang Wiedmeyer
<pre>
15 1 Wolfgang Wiedmeyer
FFMEG="ffmpeg"
16 2 Wolfgang Wiedmeyer
</pre>
17
to
18 7 doak complex
19 2 Wolfgang Wiedmeyer
<pre>
20
FFMEG="avconv"
21
</pre>
22
23
at the beginning of the script.
24
25
h2. Taking a screenshot
26 3 Wolfgang Wiedmeyer
27
Run the script to take a screenshot:
28
<pre>
29
./screencap.sh -f OUTPUT.PNG
30
</pre>
31
32
@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.
33
34
The display size in pixels is autodetected. If you want the script to take less time for a screenshot, you can add the screen size as another option, e.g.:
35
<pre>
36
./screencap.sh -s 720x1280 -f OUTPUT.PNG
37
</pre>
38 4 Wolfgang Wiedmeyer
39
h3. In recovery mode
40
41
It is possible to take screenshots in recovery mode with the script by running:
42
<pre>
43
./screencap.sh -r -s SCREENSIZE -f OUTPUT.PNG
44
</pre>
45
46
As screen size detection does not work in recovery mode, the screen size needs to be specified.