Plays scripted touch, mouse, keyboard, gamepad, pen, and digitizer input to Android
devices over USB with AOA 2.0 HID, or as uhid devices through the adb server,
and records real touches and key presses
into the same script format with adb. Linux and Windows, x86_64 and ARM64,
C++20.
promo_en.mp4
There are three programs, all built on one shared engine:
android_macro_player_gui— a desktop app for connecting, playing, seeking, and recording.aoa_touch— the command-line player.aoa_record— the command-line recorder.
All HID, AOA, and USB work is done by libaoahid; see that repository for the protocol, descriptor, and transport details. A phone can also be reached through the adb server with libadbhid (uhid devices made by a small agent on the phone), chosen on the GUI's UHID tab; that way lets every uhid setting (name, ids, control rules) be chosen.
Tested on real hardware: touchscreen, keyboard, mouse, gamepad, and media keys (the toggle profile) on a Samsung Galaxy Tab S11 and a POCO F6 Pro, from Windows 10 x64 and Arch Linux. The pen and digitizer profiles have not been tested on hardware yet.
Each release has one
archive per platform and CPU (linux-x86_64, linux-aarch64,
windows-x86_64, windows-arm64) with everything in a single folder:
android-macro-player-<version>-<platform>-<cpu>/
android_macro_player_gui[.exe] aoa_touch[.exe] aoa_record[.exe]
libaoahid, libadbhid + libusb runtime (.so / .dll)
MSVC runtime DLLs (Windows only)
csv/ scripts; recordings are saved here
docs/ the documentation the README links to
third-party/ licences of everything bundled
README.md LICENSE
Keep the folder together: the programs find the libraries and csv/ next to
themselves. On Linux, install the udev rule first (see
Linux permissions). Recording needs adb
(Android SDK Platform-Tools) on PATH; playback does not. The Windows ARM64
archive is cross-compiled, so CI checks its contents but does not run it.
On Windows, if the phone cannot be opened or the ADB Bridge does not start, the cause is often the phone's driver: libusb needs WinUSB (or libusbK / libusb0). Input alone worked with Samsung's own driver on the Galaxy Tab S11, while the ADB Bridge needed the whole device switched to WinUSB. Replacing the driver with Zadig may fix it, but it is not guaranteed on every phone; see Troubleshooting.
The programs open the phone's USB device directly, so the user running them needs write access to it. The logged-in user often has it already; if connecting fails with an access error, install the rule shipped in this repository (the same one libaoahid ships), then unplug and replug the phone:
sudo cp udev/51-aoahid.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm triggerThe phone keeps its own vendor and product IDs, so the rule gives the user at
the local seat access to USB devices through systemd-logind's uaccess tag
rather than matching one ID. The comments in
udev/51-aoahid.rules show a group-based rule for
one phone instead, for systems without logind.
| Document | What it covers |
|---|---|
| docs/GUI.md | The desktop app: devices, live control, playing, recording, the ADB and UHID tabs, settings |
| docs/CLI.md | aoa_touch (player) and aoa_record (recorder) |
| docs/CSV_FORMAT.md | The script format: rows, laps, directives, coordinates, key names |
| docs/CONTROL_API.md | The local HTTP API for driving the phone from another program |
| docs/TROUBLESHOOTING.md | Driver problems (Samsung on Windows) and known limitations |
| docs/BUILDING.md | Building from source, getting libaoahid and libadbhid, testing |
| docs/LIBRARY.md | Using android_macro_player_core in your own program |
| docs/ARCHITECTURE.md | For contributors: the core, the GUI's threads, how time is kept |
| docs/CROSS_REPO.md | For contributors: the boundaries to libaoahid, libadbhid and aoahid_adb_proxy, version pins, release order |
MIT; see LICENSE. The release archives also contain, each under
its own licence in third-party/:
- libaoahid (MIT) and libusb-1.0
(LGPL-2.1-or-later, dynamically linked, with its licence and corresponding
source), as shipped by libaoahid, under
third-party/libaoahid/ - libadbhid (MIT), with the agent it
puts on the phone embedded, under
third-party/libadbhid/ - Dear ImGui (MIT) and GLFW (zlib), linked into the GUI
- cpp-httplib (MIT), header-only, backing the control API's HTTP server
- nativefiledialog-extended (zlib), linked into the GUI for the file picker
- aoahid_adb_proxy 0.1.0
(MIT), vendored under
third_party/aoahid_adb_proxy/for the ADB Bridge - the Roboto font (Apache-2.0), embedded in the GUI
- stb_image (MIT/public domain), vendored for the background and reference images
- on Windows, the Microsoft Visual C++ runtime DLLs, redistributed under Microsoft's redistribution terms
The test suite vendors doctest (MIT, tests/third_party/LICENSE-doctest.txt);
it is not linked into any program.