I would like to remove all files from my android device INCLUDING system files. I have tried
rm -r *
and other commands but when I switch the phone off the files reappear.
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up.Sign up to join this community
You can't do this from the OS or adb, you would have to do it from fastboot or recovery such as CWM or TWRP.
fastboot erase all - note this will erase EVERYTHING, including your IMEI or MEID and other proprietary settings, the phone will likely be unrecoverable or unusable with most devices. It is blocked in some devices. Use with caution and understand the implications prior to doing this!!!
fastboot erase XXXX - Where XXXX is the partition you want to delete, like system, boot, userdata, etc.
In TWRP or CWM, you could just format the various partitions.
In most devices, these options would require an unlocked bootloader.