1# `evemu-record`
2
3This is a Rust implementation of the `evemu-record` command from the [FreeDesktop project's evemu
4suite][FreeDesktop]. It records the descriptor and events produced by a single input device in a
5[simple text-based format][format] that can be replayed using the [`uinput` command on
6Android][uinput] or the FreeDesktop evemu tools on other Linux-based platforms. It is included by
7default with `userdebug` and `eng` builds of Android.
8
9The command-line interface is the same as that of the FreeDesktop version, except for
10Android-specific features. For usage instructions, run `evemu-record --help`.
11
12## Usage example
13
14From a computer connected to the device over ADB, you can start a recording:
15
16```
17$ adb shell evemu-record > my-recording.evemu
18Available devices:
19/dev/input/event0:      gpio_keys
20/dev/input/event1:      s2mpg12-power-keys
21/dev/input/event2:      NVTCapacitiveTouchScreen
22/dev/input/event3:      NVTCapacitivePen
23/dev/input/event4:      uinput-folio
24/dev/input/event5:      ACME Touchpad
25Select the device event number [0-5]: 5
26```
27
28...then use the input device for a while, and press Ctrl+C to finish. You will now have a
29`my-recording.evemu` file that you can examine in a text editor. To replay it, use the [`uinput`
30command][uinput]:
31
32```
33$ adb shell uinput - < my-recording.evemu
34```
35
36## Android-specific features
37
38### Timestamp bases
39
40By default, event timestamps are recorded relative to the time of the first event received during
41the recording. Passing `--timestamp-base=boot` causes the timestamps to be recorded relative to the
42system boot time instead. While this does not affect the playback of the recording, it can be useful
43for matching recorded events with other logs that use such timestamps, such as `dmesg` or the
44touchpad gesture debug logs emitted by `TouchpadInputMapper`.
45
46[FreeDesktop]: https://gitlab.freedesktop.org/libevdev/evemu
47[format]: https://gitlab.freedesktop.org/libevdev/evemu#device-description-format
48[uinput]: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/cmds/uinput/README.md
49