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.4.0.tar.gz (76.1 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.4.0-py3-none-any.whl (71.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: susatest_agent-0.4.0.tar.gz
  • Upload date:
  • Size: 76.1 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.4.0.tar.gz
Algorithm Hash digest
SHA256 78f6bc7fe5841f061d8ae2fbc49df726871e3a709dc040ac22dfa72517f7d2f8
MD5 f36b28e967a6848cdf1c2dcd04517229
BLAKE2b-256 16b1e1dbe4eb550d896573bc3d8de6cf9ce17438fc550d31da3c2b21c4be1260

See more details on using hashes here.

File details

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

File metadata

  • Download URL: susatest_agent-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 71.9 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80f9b071c1d3406cad07e71042464059585635cd3c0eeabcb565a0e1952bdb4f
MD5 992dbf7f8096aed9ffc8d261e744aaa2
BLAKE2b-256 37748680624a532d44d155c3d006cdb298a4022411ad9317a8b14a0e5c63cfe1

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