How to clean app cache using script every time the phone boot? I know there's many app that clean cache every boot but I would like to use init.d/script to save storage.
Dalvik-cache is /data/dalvik-cache/arm/ as I can just rm -rf *
But, app cache is located at /data/data/app_name/cache and don't know how to automate it, because cache folder is a sub-directory
I'm new to bash scripting and this would help me significantly in programming overall
Phone is magisk'ed Android 10.
I forgot array is such a thing. I solved my own problem
# Assigning app-name into $apps
apps=($(ls /data/data/))

# Looping each app
for app in &quot;${apps[@]}&quot;; do 

  # Deleting $app/cache/ contents
  rm -rf /data/data/$app/cache/*
  done