adb_file_chmod
Change file permissions on an Android device using octal mode (e.g., 755). Supports recursive application with depth protection to prevent unsafe modifications on root-near directories.
Instructions
Change file permissions on the device. Mode must be a valid octal string (e.g., '755', '644', '600'). Recursive mode uses depth-based protection: refuses at depth ≤ 2 from root. Note: sdcardfs/FUSE ignores Unix permissions — file access on /sdcard is controlled by Android's package ownership model.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File or directory path | |
| mode | Yes | Octal permission mode (e.g., '755', '644', '0600') | |
| recursive | No | Apply recursively to directory contents. Depth-protected. | |
| root | No | Use root shell (typically required for chmod) | |
| device | No | Device serial |