kill_process
Terminate running processes by process ID using the Frida MCP server. This tool stops specified processes on mobile or desktop devices for debugging, testing, or security analysis purposes.
Instructions
Kill a process by ID.
Returns:
Status information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | No | Optional ID of the device where the process is running. Uses smart selection when omitted. | |
| pid | Yes | The ID of the process to kill. |
Implementation Reference
- src/frida_mcp/cli.py:416-436 (handler)The kill_process tool handler function. It resolves the target device using _resolve_device_or_raise, then calls the Frida device's kill method on the specified PID. Includes input schema via Pydantic Field decorators and error handling.@mcp.tool() def kill_process( pid: int = Field(description="The ID of the process to kill."), device_id: Optional[str] = Field( default=None, description="Optional ID of the device where the process is running. Uses smart selection when omitted.", ), ) -> Dict[str, Any]: """Kill a process by ID. Returns: Status information """ try: device = _resolve_device_or_raise(device_id) device.kill(pid) return {"success": True, "pid": pid} except Exception as e: raise ValueError(f"Failed to kill process {pid}: {str(e)}")