You might need to delete files or folders on multiple Android phones or tablets. It becomes even more challenging if you don’t have physical access to the devices. In either case, you might want to delete the files with minimum work.
SureMDM allows you to remotely execute script commands on Android devices using the Run Script job. You can create a run script job and deploy the job on all devices remotely.
Run Script job allows admins to remotely run customized scripts on enrolled devices.
Purpose
The purpose of this knowledge article is to provide a guide on How to Remotely Delete Files on Your Android Phones via SureMDM run scripts.
Prerequisites
The Device needs to be online for the applied run script to take effect.
Steps to Remotely Delete Files on Android Devices:
1. Navigate to SureMDM Console > Jobs > New Job > Android > Run Script.
2. Create a Run Script Job: Use one of the following commands depending on your requirements.
Delete a specific file:
rm -r /sdcard/Documents/download.png
In this example, “Documents” is the folder name, and “download.png” is the file.
Delete all files of a specific extension in a folder:
rm -r /sdcard/download/*.txt
In this example, “download” is the folder, and “*.txt” represents all text files.
Delete all files in a specific folder:
rm -r /sdcard/test/*
In this example, “test” is the folder name.
Delete all files on internal storage:
rm -r /sdcard/*
3. Click Validate > Confirmation on successful validation will be displayed > Click Insert.
4. Enter a Job Name and click Save. The newly created job will be listed in the Jobs List section.
5. Go back to Home and select the desired Android device(s).
6. Click Apply to launch the Apply Job/Profile To Device prompt.
7. In the Apply Job/Profile To Device prompt, select the job and click Apply.
Note:
Sdcard refers to Internal storage and if the files need to be transferred to any memory card then use $external$ as Device Path , E.g $external$/<Folder_Name>
By following these steps, you can efficiently manage file deletion on multiple Android devices without physical access.
If you have any questions or need help with our products, please don’t hesitate to contact our support team.