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.
42Gears UEM 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 with a single click.
Run Script job allows admins to remotely run customized scripts on enrolled devices.
To create a job and run a customized script for deleting folder and files remotely on the enrolled Android device(s), follow these steps:
1. Navigate to 42Gears UEM Console > Jobs > New Job > Android > Run Script.
2. In Run Script prompt, under the Generic option, select Delete all files inside the test folder with extensions or Delete all files (even without extensions) and folders inside the test folder.
3. Specify the folder name and files that you want to delete in the script.
For Example: rm -r /mnt/sdcard/test/*/*
4. Click Validate. A confirmation on successful validation will be displayed.
5. Click Insert.
6. Enter a Job Name and click Save. The newly created job will be listed in the Jobs List section.
7. Go back to Home and select the desired Android device(s).
8. Click Apply to launch Apply Job/Profile To Device prompt.
9. In the Apply Job/Profile To Device prompt, select the job and click Apply.
The specified folder and the files within the folder will be deleted on the Android device(s).