Skip to content

Commit daacc55

Browse files
HarryCuttsAndroid (Google) Code Review
authored andcommitted
Merge "evemu-record: add README" into main
2 parents f8dcf14 + d7b12e4 commit daacc55

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

cmds/evemu-record/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# `evemu-record`
2+
3+
This is a Rust implementation of the `evemu-record` command from the [FreeDesktop project's evemu
4+
suite][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
6+
Android][uinput] or the FreeDesktop evemu tools on other Linux-based platforms. It is included by
7+
default with `userdebug` and `eng` builds of Android.
8+
9+
The command-line interface is the same as that of the FreeDesktop version, except for
10+
Android-specific features. For usage instructions, run `evemu-record --help`.
11+
12+
## Usage example
13+
14+
From a computer connected to the device over ADB, you can start a recording:
15+
16+
```
17+
$ adb shell evemu-record > my-recording.evemu
18+
Available 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
25+
Select 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`
30+
command][uinput]:
31+
32+
```
33+
$ adb shell uinput - < my-recording.evemu
34+
```
35+
36+
## Android-specific features
37+
38+
### Timestamp bases
39+
40+
By default, event timestamps are recorded relative to the time of the first event received during
41+
the recording. Passing `--timestamp-base=boot` causes the timestamps to be recorded relative to the
42+
system boot time instead. While this does not affect the playback of the recording, it can be useful
43+
for matching recorded events with other logs that use such timestamps, such as `dmesg` or the
44+
touchpad 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

0 commit comments

Comments
 (0)