Files & Transfer
Android 1.0+
Risk: DESTRUCTIVE
Remove File / Directory
Deletes files or directories from the device storage.
Command Syntax
adb shell rm
Generic Syntax:
rm [-r|-R] [-f] [-v] <path>...
Options & Parameters
| Flag | Description |
|---|---|
| -r, -R | Recursive deletion of directories and sub-contents. |
| -f | Force deletion without confirmation, ignore nonexistent files. |
| -v | Verbose mode: explain what is being done. |
Real-World Usage Examples
Delete a single temporary file
Deletes the file.
adb shell rm /sdcard/Download/test.apk
Delete directory recursively
Deletes directory and all child items.
adb shell rm -rf /data/local/tmp/test_dir