Removing folders from DDMS

I need to delete a specific folder from /mnt/sdcard/new .

I am looking at a folder with DDMS in Eclipse.

How to delete a specific folder.

Thanks in advance.

+8
android eclipse cmd ddms
source share
5 answers
 C:\>adb shell $ rmdir /mnt/sdcard/Android/data/mydirectory/ 
+7
source share

You can use the rm command with the -r option to delete a non-empty folder.

 C:\> adb shell $ rm -r /mnt/sdcard/Android/data/mydirectory/ 

NOTE. rmdir can only delete a non-empty folder.

+11
source share

Please use the below method to delete a folder from sdcard

 // Deletes all files and subdirectories under dir. // Returns true if all deletions were successful. // If a deletion fails, the method stops attempting to delete and returns false. public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i=0; i<children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } // The directory is now empty so delete it return dir.delete(); } 

write the code below for the deleteDir () method of the call

 // Delete an empty directory boolean success = (new File("directorypath")).delete(); if (!success) { // Deletion failed Message } 
+1
source share
 boolean success = ( new File("/data/data/yourpackege/New Folder")).delete(); if (!success) { // Deletion failed Message Toast.makeText(getApplicationContext(),"not deleted : ", Toast.LENGTH_LONG).show(); }else{ Toast.makeText(getApplicationContext()," deleted : ", Toast.LENGTH_LONG).show(); } 
0
source share

If you want to delete any folder from ddms, first you need to go to the adb shell via cmd just go to the path where your sdk \ platform-tools \ is, there is your adb shell

To run the command to delete folders, you must first start your device by simply typing

 adb root 

then you can delete the folder using

 rmdir /mnt/sdcard/folder 

to delete file folders

 rm -r /mnt/sdcard/folder 

hope my answer helps anyone (newbies)

0
source share

All Articles