automationhub

command module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Automation Hub

Automation Hub runs UI tests of games on real devices, simulators and the Unity Editor. It takes care of the tedious parts: finding devices, installing and starting builds, running the tests, and collecting logs, screenshots and performance data into a report you can open in the browser.

Project overview

Supported devices

Platform Manager (config key) How it is reached
Android phones and tablets android_device ADB over USB, or adb connect for remote devices and device clouds
Android emulators android_device ADB
iOS devices ios_device usbmux and WebDriverAgent (started with xcodebuild on iOS 17 and later)
iOS Simulator ios_sim xcrun simctl
Unity Editor unity_editor Starts Unity from unity_path for the project
macOS, browsers macos, web Local host

How it works

flowchart LR
    UI["Web UI<br/>(browser)"] -- REST + SSE --> M
    AI["AI agent<br/>(MCP client)"] -- MCP --> M
    M["<b>Master</b><br/>API · web UI · database"]
    M -- "websocket<br/>JSON-RPC" --- N1["<b>Node</b><br/>Mac mini"]
    M -- "websocket<br/>JSON-RPC" --- N2["<b>Node</b><br/>Linux box"]
    N1 --- D1["iPhone / iPad<br/>iOS Simulator<br/>Unity Editor"]
    N2 --- D2["Android devices<br/>Emulators"]
    D1 -. "game with Unity plugin<br/>connects to /device/connect" .-> N1
    D2 -. "game with Unity plugin" .-> N2
    M --> DB[("SQLite or<br/>Postgres")]
    M -- results --> S["Slack"]
Master and nodes

The master (hub master) is the central service. It stores everything in the database, serves the REST API and the web UI (embedded in the binary), and runs the tests. It listens on port 8002 by default.

A node (hub node) runs on each machine that has devices attached: a Mac for iOS devices and simulators, any host with ADB for Android. The node finds the devices with the managers enabled in its config and connects to the master over a websocket (/node/connect), authenticated with a node token created under Settings → Nodes. Over that connection the master calls the node with JSON-RPC to list devices, install and start apps, take screenshots, stream video and forward taps and swipes. The master shows the devices of all nodes together in its Device Pool.

To keep a small setup simple, a node can run on the same machine as the master.

Running a test
  1. Upload a build. An .apk or .ipa is uploaded to an app of a project (in the UI, through the API, or with the MCP upload_bundle tool). The master stores it and pushes it to the node that needs it.
  2. Define the test. A test says what runs (all Unity tests, a category, or picked test methods; or a scenario of install, start, test and checkpoint steps), where (picked devices or all of them) and how: concurrent spreads the tests over the free devices for faster results, simultaneous runs every test on every device for more accurate results.
  3. Start a run. For each device, the hub installs the build and starts it with a session ID, the node URL and the device ID as launch arguments.
  4. The game connects back. The Automation Hub Unity plugin inside the game opens a websocket to the node (/device/connect) and identifies itself with the device ID. From then on the hub can ask the game for its scene graph as XML, find elements by XPath, touch, drag, scroll, set values and take screenshots, and it can start the Unity tests inside the game.
  5. Collect the results. Every test produces a protocol with its log, screenshots and performance samples (frame rate, memory, CPU, vertices, triangles) at each checkpoint. The UI updates live through server-sent events, and a Slack hook can post the result when the run ends.

What it looks like

Tests show what runs where, and every run with its result.

A test with its runs

Test runs list each test on each device, how long the app took to start, and the build that was tested.

A test run

Protocols show why a test failed, its full log and screenshots, and how its performance compares with earlier runs.

Protocol of a failed test

Performance of a test

Bundles are the uploaded builds of an app, with tags, size and how often they were tested.

Uploaded bundles

The Device Pool lists all devices of the project, grouped by the node they are connected to. From there you can open a device and take live control of it, with video and touch input.

Device pool

The screenshots show made-up demo data.

Installation

Requirements
  • Android: ADB (Android platform tools)
  • iOS: Xcode, and WebDriverAgent for real devices
  • Unity Editor tests: a Unity installation
Install with Homebrew on macOS

The hub is part of a private tap for now:

brew install fsuhrau/tap/automationhub
Build from source
make buildMac      # or buildLinux / buildWindows, results in bin/<os>

This builds the web UI into endpoints/web/data and embeds it in the binary.

Configure

Create a configuration with the wizard, then adjust it by hand:

hub configure

The main settings (see example_config.yaml for more):

identifier: 6b1c...            # unique ID of this hub, created by the wizard
port: 8002
host_ip: 192.168.0.10          # IP that devices use to reach this machine
node_url: ws://192.168.0.10:8004/device/connect  # node only: where games connect to
master_url: 192.168.0.10:8002  # node only: where the master runs
cors:                          # other origins allowed to call the API; without
  - https://qa.example.com     # this list only localhost pages are allowed
database:
  sqlite:
    path: ./automationhub.db   # or postgres: host, port, user, password, database
auth:
  token:
    auth_token: ...            # node only: the node token from Settings → Nodes
managers:
  android_device:
    enabled: true
  ios_device:
    enabled: true
  ios_sim:
    enabled: true
  unity_editor:
    enabled: true
    unity_path: /Applications/Unity/Hub/Editor/6000.0.0f1/Unity.app/Contents/MacOS/Unity
  node:                        # master only: accept devices from nodes
    enabled: true
hooks:
  - provider: slack            # post test results to Slack
    token: xoxb-...
    username: automationhub
    channel: qa-results

Users can sign in with a password, GitHub or another OAuth2 provider (auth.password, auth.github, auth.oauth2). API clients and the MCP endpoint use access tokens from Settings → Access tokens or personal tokens from the profile page, sent in the X-Auth-Token header.

Run

Start the master:

hub master --config automationhub.yaml

It serves the API and the web UI on the configured port, for example http://localhost:8002.

Start a node on every machine with devices:

hub node --config automationhub_node.yaml
Run as a service on macOS

The wizard can create a LaunchAgent for the hub:

launchctl load ~/Library/LaunchAgents/com.automationhub.master.plist

AI agents (MCP)

The master is also an MCP server, at /api/<project>/mcp. An agent such as Claude Code can use it to run tests and read their results (list_apps, upload_bundle, run_test, wait_for_test_run, get_protocol, …) and to control a device directly (lock_device, screenshot, get_hierarchy, tap, swipe, type_text, …). Elements of a connected Unity game can be addressed by XPath on the scene graph.

hub mcp-proxy runs a local proxy on 127.0.0.1:18092 that adds your access token, so the token stays out of the agent's configuration:

hub mcp-proxy --upstream http://hub.example.com:8002 --project pocket-kingdom

Development

make server    # run the master with automationhub.yaml
make node      # run a node with automationhub_slave.yaml
make run       # web UI dev server, proxies /api to :8002
make frontend  # build the web UI into endpoints/web/data
make proto     # regenerate the node protobuf code

The backend is Go (go test ./...), and the web UI is React with Vite and MUI in frontend/.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package apperr classifies errors by what went wrong, not by how a transport reports it.
Package apperr classifies errors by what went wrong, not by how a transport reports it.
github
Package github signs users in with their GitHub account.
Package github signs users in with their GitHub account.
oauth2
Package oauth2 signs users in with any OAuth2 provider that has a user endpoint.
Package oauth2 signs users in with any OAuth2 provider that has a user endpoint.
oauthflow
Package oauthflow is the OAuth2 authorization-code sign in shared by the GitHub and the generic OAuth2 provider.
Package oauthflow is the OAuth2 authorization-code sign in shared by the GitHub and the generic OAuth2 provider.
oauthflow/flowtest
Package flowtest runs the sign in scenarios every OAuth2 provider must pass against a fake identity provider.
Package flowtest runs the sign in scenarios every OAuth2 provider must pass against a fake identity provider.
password
Package password signs users in with an email address and a password.
Package password signs users in with an email address and a password.
usersession
Package usersession keeps the signed-in user in a cookie session.
Package usersession keeps the signed-in user in a cookie session.
cli
api
cmd
androiddevice/adb
Package adb runs adb commands for one device through a device.CommandRunner.
Package adb runs adb commands for one device through a device.CommandRunner.
androiddevice/scrcpy
Package scrcpy streams the screen of an Android device as H.264 video with the scrcpy server (https://github.com/Genymobile/scrcpy, Apache-2.0).
Package scrcpy streams the screen of an Android device as H.264 video with the scrcpy server (https://github.com/Genymobile/scrcpy, Apache-2.0).
hostinfo
Package hostinfo reads facts about the machine a node runs on (OS name and version, host name, hardware identity) through an injected command runner, so the macos and web platforms share one implementation that tests on any OS.
Package hostinfo reads facts about the machine a node runs on (OS name and version, host name, hardware identity) through an injected command runner, so the macos and web platforms share one implementation that tests on any OS.
hostinfo/hostinfotest
Package hostinfotest holds the test fakes shared by the macos and web platform tests.
Package hostinfotest holds the test fakes shared by the macos and web platform tests.
luascript
Package luascript runs the hub Lua scripts shared by the Android and iOS devices.
Package luascript runs the hub Lua scripts shared by the Android and iOS devices.
web
api
Package api is the REST endpoint of the hub: it mounts the handlers of every resource under /api.
Package api is the REST endpoint of the hub: it mounts the handlers of every resource under /api.
api/apps
Package apps is the HTTP adapter of the apps and their parameters: it reads the request, calls the app service and writes the result.
Package apps is the HTTP adapter of the apps and their parameters: it reads the request, calls the app service and writes the result.
api/bundles
Package bundles is the HTTP adapter of the bundles of an app: it reads the request, calls the app service and writes the result.
Package bundles is the HTTP adapter of the bundles of an app: it reads the request, calls the app service and writes the result.
api/devices
Package devices is the HTTP adapter of the device use cases: it reads the request, calls one service method and writes the result.
Package devices is the HTTP adapter of the device use cases: it reads the request, calls one service method and writes the result.
api/internal/appfixture
Package appfixture is the test setup of the app and bundle routes: the api with two projects that have an app each, a temporary bundle folder, and helpers to store bundles and send raw and multipart requests.
Package appfixture is the test setup of the app and bundle routes: the api with two projects that have an app each, a temporary bundle folder, and helpers to store bundles and send raw and multipart requests.
api/internal/runfixture
Package runfixture is the test setup of the run, protocol, overview and stats routes: the api with two projects that have one app, test and run each.
Package runfixture is the test setup of the run, protocol, overview and stats routes: the api with two projects that have one app, test and run each.
api/overview
Package overview holds the HTTP handlers of the project overview and statistics.
Package overview holds the HTTP handlers of the project overview and statistics.
api/profile
Package profile is the HTTP adapter of the signed in user: the profile and the personal access tokens.
Package profile is the HTTP adapter of the signed in user: the profile and the personal access tokens.
api/projects
Package projects is the HTTP adapter of the project use cases.
Package projects is the HTTP adapter of the project use cases.
api/protocols
Package protocols holds the HTTP handlers of the protocols of a test run: the protocol page and the baselines its performance is compared with.
Package protocols holds the HTTP handlers of the protocols of a test run: the protocol page and the baselines its performance is compared with.
api/runs
Package runs holds the HTTP handlers of the test runs of an app: paging through them, the run page, starting and cancelling a run.
Package runs holds the HTTP handlers of the test runs of an app: paging through them, the run page, starting and cancelling a run.
api/settings
Package settings is the HTTP adapter of the project settings: the users, the access tokens of the project and the nodes.
Package settings is the HTTP adapter of the project settings: the users, the access tokens of the project and the nodes.
api/tests
Package tests holds the HTTP handlers of the test definitions of an app: they parse the request, call the test service and write the answer.
Package tests holds the HTTP handlers of the test definitions of an app: they parse the request, call the test service and write the answer.
control
Package control exposes the live device control API under /api/:project_id/device/:device_id/...
Package control exposes the live device control API under /api/:project_id/device/:device_id/...
httpx
Package httpx is the one place where the api turns errors and requests into HTTP: the status of an apperr kind, the error body, and the readers for path ids, the limit parameter and the project and app of a request.
Package httpx is the one place where the api turns errors and requests into HTTP: the status of an apperr kind, the error body, and the readers for path ids, the limit parameter and the project and app of a request.
mcp
Package mcp embeds a Model Context Protocol server in the master.
Package mcp embeds a Model Context Protocol server in the master.
web
hub
control
Package control provides interactive (live) device control on top of the device layer: native input, screenshots, logs, app lifecycle and app-level actions through the Unity plugin.
Package control provides interactive (live) device control on top of the device layer: native input, screenshots, logs, app lifecycle and app-level actions through the Unity plugin.
node/jsonrpc
Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package.
Package jsonrpc implements a JSON-RPC 1.0 ClientCodec and ServerCodec for the rpc package.
session
Package session manages the test sessions of the hub and stores their files.
Package session manages the test sessions of the hub and stores their files.
sse
videostream
Package videostream moves device video streams over websockets: from a node to the master, and from the master to the browser.
Package videostream moves device video streams over websockets: from a node to the master, and from the master to the browser.
videostream/videostreamtest
Package videostreamtest has a fake device.VideoStream for tests.
Package videostreamtest has a fake device.VideoStream for tests.
internal
apitest
Package apitest builds the real api router for tests: the services the composition root (internal/wiring) builds and the same RegisterRoutes the hub calls, backed by an in-memory database and the testkit fakes, so tests go through HTTP and not through the internals of the api.
Package apitest builds the real api router for tests: the services the composition root (internal/wiring) builds and the same RegisterRoutes the hub calls, backed by an in-memory database and the testkit fakes, so tests go through HTTP and not through the internals of the api.
testkit
Package testkit is the shared kit for Go tests: an in-memory database, seed builders, fakes of the device and manager interfaces, a fake clock and command runner, and HTTP helpers.
Package testkit is the shared kit for Go tests: an in-memory database, seed builders, fakes of the device and manager interfaces, a fake clock and command runner, and HTTP helpers.
wiring
Package wiring is the composition root of the hub: it builds the database connection, stores, services, managers and endpoints of a master or a node exactly once and hands each of them only what it needs.
Package wiring is the composition root of the hub: it builds the database connection, stores, services, managers and endpoints of a master or a node exactly once and hands each of them only what it needs.
modules
service
access
Package access is the use cases of who may use the hub: the users, the access tokens of a project, the personal tokens of a user and the nodes with their tokens.
Package access is the use cases of who may use the hub: the users, the access tokens of a project, the personal tokens of a user and the nodes with their tokens.
app
Package app is the use cases of apps and their bundles: creating and editing apps and their parameters, listing, reading, archiving and deleting bundles, and storing an uploaded build.
Package app is the use cases of apps and their bundles: creating and editing apps and their parameters, listing, reading, archiving and deleting bundles, and storing an uploaded build.
device
Package device holds the use cases around the devices of a project: the list and detail views with their live state, editing, deleting, unlocking, running tests on a device and the results that ran on it.
Package device holds the use cases around the devices of a project: the list and detail views with their live state, editing, deleting, unlocking, running tests on a device and the results that ran on it.
internal/validate
Package validate holds the input rules the services share.
Package validate holds the input rules the services share.
overview
Package overview holds the project overview and the project statistics: what a project has, which tests need attention, what runs now and what ran last.
Package overview holds the project overview and the project statistics: what a project has, which tests need attention, what runs now and what ran last.
project
Package project is the use cases of the projects: listing, creating, renaming and deleting them.
Package project is the use cases of the projects: listing, creating, renaming and deleting them.
protocol
Package protocol holds the use cases around the protocols of a test run: the protocol page with the history it is compared with, and the baselines a protocol's performance can be compared against.
Package protocol holds the use cases around the protocols of a test run: the protocol page with the history it is compared with, and the baselines a protocol's performance can be compared against.
run
Package run holds the use cases around test runs: starting one on the devices of a test, cancelling it, and reading runs, protocols and their logs.
Package run holds the use cases around test runs: starting one on the devices of a test, cancelling it, and reading runs, protocols and their logs.
test
Package test is the use cases of the test definitions: listing and reading the tests of an app, creating them and saving the edit page.
Package test is the use cases of the test definitions: listing and reading the tests of an app, creating them and saving the edit page.
accessstore
Package accessstore is the gorm repository of users, access tokens and nodes.
Package accessstore is the gorm repository of users, access tokens and nodes.
appstore
Package appstore is the gorm repository of apps, their parameters and their bundles.
Package appstore is the gorm repository of apps, their parameters and their bundles.
devicestore
Package devicestore is the gorm repository of devices.
Package devicestore is the gorm repository of devices.
overviewstore
Package overviewstore is the gorm repository of the project overview and statistics.
Package overviewstore is the gorm repository of the project overview and statistics.
projectstore
Package projectstore is the gorm repository of the projects.
Package projectstore is the gorm repository of the projects.
runnerstore
Package runnerstore is the gorm repository of the test runners: it creates the run, appends to its log and reads the configured unity tests.
Package runnerstore is the gorm repository of the test runners: it creates the run, appends to its log and reads the configured unity tests.
runstore
Package runstore is the gorm repository of test runs and their protocols.
Package runstore is the gorm repository of test runs and their protocols.
storeerr
Package storeerr maps the errors of the storage layer (gorm) to apperr kinds, so handlers and services only ever see apperr errors.
Package storeerr maps the errors of the storage layer (gorm) to apperr kinds, so handlers and services only ever see apperr errors.
teststore
Package teststore is the gorm repository of the test definitions.
Package teststore is the gorm repository of the test definitions.
base/basetest
Package basetest has the fakes the runner tests share: an app connection that answers the actions of a test run, and the setup of a run.
Package basetest has the fakes the runner tests share: an app connection that answers the actions of a test run, and the setup of a run.
recording
Package recording records the screens of the devices of a test run, so the run can be replayed next to its log.
Package recording records the screens of the devices of a test run, so the run can be replayed next to its log.
scenario
Package scenario runs the steps of a scenario on the devices.
Package scenario runs the steps of a scenario on the devices.
unity
Package unity runs the tests of a unity app: the app lists its tests, each is started on the devices and reports back its protocol.
Package unity runs the tests of a unity app: the app lists its tests, each is started on the devices and reports back its protocol.
tools
androidsdk
Package androidsdk locates Android SDK tools for processes whose PATH lacks them, e.g.
Package androidsdk locates Android SDK tools for processes whose PATH lacks them, e.g.
mcpproxy
Package mcpproxy is a host-side proxy for the master's MCP endpoint.
Package mcpproxy is a host-side proxy for the master's MCP endpoint.
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL