adb_rm
Delete files or directories on Android devices, with depth-protected recursive removal and hard blocks for critical system paths to prevent unsafe deletes.
Instructions
Delete a file or directory on the device. Recursive deletion uses depth-based protection: refuses at depth ≤ 2 from root (blocks rm -rf /system or /sdcard but allows /sdcard/project/build/). Symlinks are resolved before depth checks to prevent traversal bypasses. Hard-blocks /dev, /proc, /sys. For recursive deletes, reports a pre-flight file count.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "adb_rm"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File or directory path to delete | |
| root | No | Use root shell for protected paths | |
| device | No | Device serial | |
| recursive | No | Delete directory recursively (-rf). Depth-protected. |