Skip to main content

Local agent for SUSATest — connects your Android or Windows device to the cloud testing platform

Project description

susatest-agent

Local agent for SUSATest — connects your Android device to the cloud testing platform.

Install

pip install susatest-agent

Usage

  1. Get your API key at: https://susatest.com/app/settings
  2. Connect your Android device via USB (USB debugging enabled)
  3. Run:
susatest-agent connect --api-key susa_YOUR_API_KEY

Your device will appear in the SUSATest dashboard. Upload an APK and tests run directly on your phone.

Requirements

  • Python 3.9+
  • ADB installed (adb in PATH) — comes with Android Studio
  • Android device connected via USB with USB debugging enabled

Commands

# Connect to SUSATest (default server)
susatest-agent connect --api-key susa_xxxx

# Connect specific device (if multiple)
susatest-agent connect --api-key susa_xxxx --device R5CR1234567

# Custom server URL
susatest-agent connect --api-key susa_xxxx --server https://your-server.com

# Custom ADB path
susatest-agent connect --api-key susa_xxxx --adb-path /path/to/adb

# Agent-side network capture (SPEC-114, see below)
susatest-agent prepare-device --device <serial>
susatest-agent connect --api-key susa_xxxx --device <serial> --with-proxy

How It Works

The agent runs an HTTP long-poll loop against susatest.com (no WebSocket; App Runner doesn't support WS). When you start a test on the website:

  1. Server queues commands (tap, screenshot, swipe, etc.) for your agent
  2. Agent polls /api/agent/poll (blocks up to 30s)
  3. Agent executes commands via ADB on your local device
  4. Agent POSTs results back to the server

No inbound ports needed — the connection is outbound only.

Agent-side network capture (SPEC-114)

For HTTPS traffic capture during mobile sessions (feeds the pentest layer), the agent can run a local mitmproxy that the test device is configured to proxy through. This needs one-time prep per device.

One-time prep

pip install -U mitmproxy frida-tools requests
susatest-agent prepare-device --device <serial>

prepare-device walks you through:

  1. Generating the mitmproxy CA cert (auto-runs mitmdump --version).
  2. Pushing the CA to /sdcard/mitmproxy-ca-cert.cer.
  3. Opening the device's certificate-install screen (you tap through: name the cert → OK).
  4. Detecting the device CPU arch + pushing the matching frida-server binary to /data/local/tmp/frida-server.
  5. Creating /sdcard/.susatest-test-rig marker so subsequent runs know this is a prepared rig.

Per session

susatest-agent connect --api-key susa_xxxx --device <serial> --with-proxy

The --with-proxy flag runs preflight on startup; if any check fails (mitmdump missing, CA cert missing, marker file absent), the agent prints actionable fix steps and exits non-zero rather than starting in a broken state.

When a session starts on the server, the agent receives start_proxy, spawns mitmdump on a free local port (9100+), configures the device's HTTP proxy via adb reverse, optionally injects a Frida SSL pinning bypass on app spawn, and the mitmproxy addon POSTs each captured flow to the SUSA backend's ingest endpoint. Flows include the full request

  • response (headers, bodies up to 10KB, status, response time).

For the operator validation runbook see docs/SPEC-114-PHASE-4-RUNBOOK.md in the SUSA repo.

Force flag (NOT recommended for daily-driver phones)

susatest-agent connect --api-key susa_xxxx --device <serial> --with-proxy --force

--force skips the test-rig marker check. Use only on devices you've manually prepared. Do not use on a phone you use for normal browsing — the proxy setting would route all your HTTP traffic through a defunct proxy after the agent stops.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

susatest_agent-0.3.0.tar.gz (48.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

susatest_agent-0.3.0-py3-none-any.whl (43.2 kB view details)

Uploaded Python 3

File details

Details for the file susatest_agent-0.3.0.tar.gz.

File metadata

  • Download URL: susatest_agent-0.3.0.tar.gz
  • Upload date:
  • Size: 48.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for susatest_agent-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1bdabf691cf5c300896cad4275168ca89c25c8fb14964e1eee3f43d265d76db8
MD5 fcd1276b8d7100557a150b403134ced0
BLAKE2b-256 58137211cb86dc6191837b8281bc66f714aa91db6c6278e0bc9552fa3a64ac93

See more details on using hashes here.

File details

Details for the file susatest_agent-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: susatest_agent-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 43.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for susatest_agent-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff5571e8a0799a61cda0dea8a7d948fbb5a1d4b210bafc8c7e66e240c85e0b15
MD5 4d640d86f5457f992b4b1ca5ae54bf48
BLAKE2b-256 cd6be156fa866642995c060b99c1715ea887538735fdcd559fa14bda89682ac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page