Known failure modes and their fixes, from every repo's README. When unsure, open the viewer's /api/status first: it reports every dependency's state.
| Symptom | What to do |
| Run fails: controller unreachable / device not connected | Start the Mobile Controller on the Mac first. A device id must be an adb serial or iPhone UDID the controller currently serves; check run_on_device.py --list-devices. |
SCRIPT step calling adb fails | SCRIPT and DIAGNOSE run on the MonkeyTester host (Linux), where adb isn't available. Drive the phone with test steps, or run adb on the Mac outside the test. |
| iPhone black-screens every capture | The phone is locked. Passcode/Face ID can't be sent by WDA. Keep it unlocked and awake; the runner refuses to start and the unlock action reports it. |
| iOS app data survives restarts | There is no pm clear on iOS. Use REINSTALL_APP: true in the case's INSTRUCTION.txt or an UNINSTALL step. |
Run shows Error, was running | The stale-run watchdog stamped it interrupted (no filesystem activity for MT_STALE_RUN_SECS): a host shutdown, SIGKILL or a viewer restart. The build's run then reads as failed. |
| "Gave up after 300s waiting for an iPhone to connect" | No device of that platform was connected when the run's turn came. Connect it (trusted, unlocked) or raise MT_DEVICE_CONNECT_WAIT_SECS. |
| Zero tests / wrong cases | Every mt-tests/<case>/ needs an INSTRUCTION.txt and a test .txt; the check fails on zero tests. |
Build conclusion success but the run failed anyway | success means the apps were uploaded — the run's own verdict decides: a recording run (record-snapshots mode) counts as a failure; passed needs a completed run, runner exit 0, at least one test and no failures. |
| Symptom | What to do |
| First iOS session hangs for minutes | Normal: WebDriverAgent is being built and signed onto the phone. Watch /tmp/monkeytester-mobile-controller.log. |
| iOS fails at signing from the LaunchAgent | The signing identity must be unlocked in the login keychain for that agent — run security find-identity -v -p codesigning, and when macOS asks for keychain access choose Always Allow. Check the team ID. |
| Wireless Android phone not listed | Pairing is per host: it must be paired with the Mac. Pair via the controller's adb, or list it in ADB_CONNECT. |
| adb missing on the Mac | The controller looks in ANDROID_HOME (default ~/Library/Android/sdk/platform-tools) or ADB_BIN. Install the SDK there or point at the binary. |
iOS recording fails (/record) | The XCUITest recorder is an insecure driver feature: the controller spawns Appium with --allow-insecure xcuitest:xctest_screen_record. If you run Appium yourself (APPIUM_URL), start it with that flag. |
| Two controllers on one Mac | Unload the other's LaunchAgent. Ports won't clash, but both would control the same phones. |
| Symptom | Fix |
Ollama is not installed / model missing | Run bin/monkeytester-ai setup. |
Port 11435 already in use | A previous run is alive: lsof -i :11435, stop it, or set MTAI_OLLAMA_PORT. |
Address already in use (8091) | Something holds the port (often the old login service). Check status, or set MTAI_PORT. |
401 from ask or the viewer | Token mismatch: the panel's pairing token must equal the service's MTAI_TOKEN. |
503 model backend unavailable | Ollama down/restarting — .runtime/logs/ollama.log. |
503 GitHub Copilot is not signed in | Sign in again in the panel, or switch to Local. |
Copilot 401/403 upstream_error | GitHub refused the sign-in (subscription ended, token revoked, editor API changed). Remove and sign in again; Local is unaffected. |
could not reach <address>/v1/models | Remote server off, address wrong, or not OpenAI-compatible — curl <address>/v1/models from the Mac. |
the remote server rejected the API key | The server needs --api-key and none/wrong key set. Replace it. |
| Viewer Test times out | It waits 15 s; the model reloads after 30 min idle. Retry and check status shows the model loaded. |
| Other machines can't connect | Confirm --lan was used and the macOS firewall allows incoming connections for Python. |
| Digest error at setup | Ollama republished the model; if you trust the new version, update the pin in monkeytester_ai/config.py. |
| Slow answers / swapping | Close memory-heavy apps (Xcode), or use the 3B model. |
| Taps land in the wrong place | Run the ask check on tests/fixtures/target.png. If that answers right, the problem is that screen — describe it more specifically. |
| Symptom | What to do |
Build ends failure without any device being touched | The fetch or the code host failed: no code host token saved → 409 not_configured; the code host unreachable or refusing → forge_unreachable / forge_refused (its HTTP status comes as forge_status); unknown branch → 404 not_found. The Settings ✗ per project names the reason. For GitHub the code host URL is the web address — https://github.com or https://<host> for Enterprise — and the token must at least read the repo. |
| A platform is greyed out in Build & Test | The plugin can't build it: it detects Xcode (ios) and an Android SDK (android) at start — a Linux host only offers Android. GET /health lists the platforms; BUILD_LOCAL_PLATFORMS can force a subset. |
| iPhone tests Unavailable in an otherwise-green run | The IPA didn't build (usually signing): the plugin uploaded that platform as a build error (--ios-build-error + --ios-build-log in its submit step), so the run still fails. Fix signing — provisioning profile must include the iPhone's UDID, no simulator builds, and the signing identity must be unlocked in the login keychain of the user the plugin's agent runs as. |
Build stays queued | Builds run one at a time (FIFO): an earlier build is still running — its /health queue block names it. Cancel a queued or running build from Build & Test (the plugin terminates the script's whole process group) and watch GET /builds/<ref>/log. |
Upload refused with 401 | After the security update uploads need the CI token: generate one in Settings (Generate new CI token, shown once) and store it as the app repo's MT_CI_TOKEN secret. A newly generated token replaces the old one. See Build & Test → The CI token. |
| A service exits at start about a missing token | It is bound to a non-loopback address without a token, which every service refuses after the security update. Set its token (e.g. CONTROLLER_TOKEN, PLUGIN_TOKEN, MTAI_TOKEN) or bind it to 127.0.0.1. See Security. |
| The viewer only shows a login page | Login is always required. On first start the only account is admin / admin — sign in and change its password; other people get accounts from the admin on Settings → Users. |
| Viewer upgraded from the old built-in Gitea client | One-time migration, automatic: gitea_config.json becomes the build-local plugin at MT_BUILD_LOCAL_URL (default http://127.0.0.1:8094) plus one project per saved repo; the first time that plugin reports its code host not configured, the viewer sends the saved URL and token to its POST /config once. On success gitea_config.json is rewritten without the token and renamed gitea_config.json.migrated. MT_BUILD_PLUGINS=name=url[,…] is imported the same way, once. |