High Performance
C++ core engine, Lua/Python script execution, millisecond-level response
C++ core, with Lua and Python scripting
中文 | English
Wingman is a cross-platform game automation tool.
local wingman = require("wingman")
-- hello.lua
-- 截图(capture 返回布尔:是否成功)
local ok = wingman.screen.capture()
-- 查找颜色(返回 {point, found} 数组表,Lua 不展开多返回值,取 res[1] / res[2])
local res = wingman.screen.findColor(0xFF0000, {x = 0, y = 0, width = 1920, height = 1080}, 10)
if res[2] then
wingman.input.click(res[1].x, res[1].y)
end
-- 多点查找用 findColors(返回点数组):wingman.screen.findColors(0xFF0000, region, 10, 0)# hello.py
from wingman import screen, input
# 截图(capture 返回布尔:是否成功)
ok = screen.capture()
# 查找颜色(返回 [point, found] 两元组;区域用字典)
pt, found = screen.findColor(0xFF0000, {"x": 0, "y": 0, "width": 1920, "height": 1080}, 10)
if found:
input.click(pt["x"], pt["y"])
# 多点查找用 find_colors(返回点数组):screen.find_colors(0xFF0000, region, 10, 0)The Android on-device Agent (experimental, arm64 / Android 9.0+): it dials out over TCP to the Go central controller, and its script APIs carry the same names and shapes as the desktop runtime (wingman.input / wingman.screen / wingman.vision), with the Dashboard handling delivery and inspection uniformly.
Capability list
| Capability | Description |
|---|---|
| Gesture injection | The accessibility service injects taps and swipes (wingman.input.tap / swipe / delay) |
| Screen capture | Real-time screen-projection capture via MediaProjection (frames are produced while the screen is on) |
| Color / image search | wingman.vision.findColor / findImage (on-device uses the pure C++ PatternMatcher; the desktop API of the same name goes through OpenCV, and the two paths use different score conventions) |
| Remote screenshots | The screenshot step of a Dashboard workflow puts the image on screen directly |
| token authentication | A registration-token allowlist via WINGMAN_AGENT_TOKENS on the server side (off by default, may be left empty) |
| Keep-alive | Boot auto-start, crash self-restart (exponential backoff), a 30s core watchdog, plus per-model keep-alive and restricted-settings guidance |
Getting the APK
From the nightly Release, take wingman-*-android-arm64.apk (debug signed): releases/tag/nightly — from that page's Assets, pick the newest wingman-<date>-nightly-<sha>-android-arm64.apk (daily builds keep only the latest of the day; direct anonymous download, no GitHub login required).
Getting started
Start the Go server (orchestrator/server, Dashboard port 9527, agent port 8888).
Install the APK on the phone (same subnet as the server) → open the App → fill in the server IP / port / device ID → tap "Start Agent". The first launch creates a persistent notification (required by the foreground service); if the server has WINGMAN_AGENT_TOKENS configured, enter the registration Token as well.
The device appears in the Dashboard's Agent list (platform=android); create a new script print('hello android') and run it against that device, with live logs streaming back.
Enable the A2 capabilities: turn on the injection service under "Accessibility Settings" in the App and grant "Enable screen projection" (on Android 14+ every restart of screen projection pops the authorization dialog again, a system constraint), then deliver a color-search / gesture script:
local pt = wingman.vision.findColor(0xE23B3B, 10)
if pt then wingman.input.tap(pt.x, pt.y) end
wingman.input.swipe(540, 1800, 540, 600, 400)Remote screenshot: add a screenshot step to a Dashboard workflow and select that device → the image is put on screen.
On Android 13+, accessibility for sideloaded apps is blocked by default under "restricted settings": system Settings → Apps → Wingman Agent → ⋮ → Allow restricted settings, or pre-authorize with scripts/android-restricted-settings.sh allow (there is in-app guidance too).
For detailed acceptance steps and known boundaries see apps/android/README.md, for the design and protocol see Android Agent Design, for per-model keep-alive see Android Agent Keep-alive, and for restricted settings see Android Agent Restricted Settings.
# 克隆仓库
git clone https://github.com/cuihairu/wingman.git
cd wingman
# Windows (MSVC + vcpkg; requires VCPKG_ROOT)
powershell -ExecutionPolicy Bypass -File build-scripts/ci/configure-windows.ps1
cmake --build build --config Release
# Linux (GCC/Clang)
cmake -B build -S . -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux
# macOS (Intel 用 x64-osx,Apple Silicon 用 arm64-osx)
cmake -B build -S . -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-osx# CLI 运行时(Python 脚本同理,需启用 WINGMAN_ENABLE_PYTHON)
./build/apps/agent/wingman-agent script examples/lua_scripts/hello.lua