frida_trace
Injects a Frida script into a spawned or running app and captures its console output for a fixed time window, making instrumentation results easy to collect.
Instructions
Spawn or attach to a process on a device, inject a Frida script, and capture whatever it prints within a fixed time window - not an interactive Frida session: it runs the script, waits timeoutSeconds, then kills the session. Hitting the timeout is the normal way a trace ends (timedOut: true), not a failure. The script runs inside the target app and can modify its behavior and state, and spawn mode launches the app. Returns { target, mode, scriptPath, timedOut, stdout, stderr } where stdout is whatever the script printed (e.g. console.log output) and scriptPath is where the script was saved in the workspace. Find targets with frida_list_processes. Requires frida-tools and a matching frida-server on the device.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | spawn starts the app fresh with the script loaded from the start; attach hooks an already-running process. Default spawn. | spawn |
| script | Yes | Raw Frida JavaScript source to inject, e.g. an Interceptor.attach(...) hook that console.logs arguments. | |
| target | Yes | In spawn mode, the package name to launch, e.g. "com.example.app". In attach mode, a PID (digits only) or a running process name. | |
| workspace | No | Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default". | |
| deviceSerial | No | Device serial from adb_devices, e.g. "emulator-5554" or "R58M123ABC". Only needed when more than one device is connected; omit otherwise. | |
| timeoutSeconds | No | How long to let the script run before stopping it. Default 15, capped at 60. |