Clean application cache with tasker?

6,915 views
Skip to first unread message

K.P. Smith

unread,
Mar 17, 2012, 12:38:29 PM3/17/12
to tas...@googlegroups.com
After a bunch of googling, reading the "to do" list, and searching these forums, I'm starting to believe the only way to use tasker to clean application cache is by scripting it and having tasker execute the script when the event occurs (screen off).  Is that true?  My thought is this can't be and the answer is staring me in the face.

Any thoughts?

Pent

unread,
Mar 17, 2012, 6:23:31 PM3/17/12
to Tasker
> forums, I'm starting to believe the only way to use tasker to clean
> application cache is by scripting it and having tasker execute the script
> when the event occurs (screen off).  Is that true?  My thought is this
> can't be

I don't think that's so suprising since a) I don't think Android has
an API
for it b) it's not exactly a common request :-)

Pent

K.P. Smith

unread,
Mar 18, 2012, 9:58:13 AM3/18/12
to tas...@googlegroups.com
Thanks for the quick response.  There certainly has to be a way to achieve this as there are a vast amount of apps doing this now.  For example, the free application History Eraser does this without requiring special permissions, while more powerful options for rooted users also exist.  In fact, history eraser doing exactly what I'm targeting (screen off - clear cache) so until i figure out the nuances of accomplishing it through Tasker, I'm using that.  I'm challenging myself to use Tasker to replace as many apps as possible so continuing to use history eraser is contrary to my goal.

Also, while it may not be a common request for Tasker to do this (me now and another guy in 2010), a search in the market of "cache" returns a thousands of cache cleaning apps.  The first 3 results have over a million downloads each so a demand for this function exists.  Maybe you'd consider it if for nothing more than including Tasker into that multi million download niche that it currently has no exposure to.  Your users get new functionality and Tasker gains more market exposure in a highly searched query .... win win :)

Thanks for reading!

Justin Tappero

unread,
Mar 18, 2012, 6:37:25 PM3/18/12
to tas...@googlegroups.com
Going to have to agree with KP on this one.  The ability to have Tasker handle cache cleaning would be an excellent feature to have.   

K.P. Smith

unread,
Mar 18, 2012, 8:39:28 PM3/18/12
to tas...@googlegroups.com
- create a new profile called clean cache
- first context is event/display/display off
- add a task for misc/run shell
- paste the following into the command line :

#!/system/bin/sh

busybox find /data/data -type d -iname "cache*" -exec busybox rm -f {}/ ';' -exec echo "Cleared {}" ';'

- check mark the use root option.
- execute the task while the screen is on so you can allow su permission

Works for me. Cheers!

bobloblaw

unread,
Mar 20, 2012, 10:31:08 PM3/20/12
to Tasker
On this, any way to have tasker delete cookies? Although, I have yet
to find an app to do the same. Cookies are important to manage for
security, as I may forget to log off a website and auto clearing the
cookies logs off for me :)

Andrea Z.

unread,
Jul 30, 2012, 4:40:32 PM7/30/12
to tas...@googlegroups.com
there is one little error in the script below:
it should be rm -fr instead of rm -f
To discover this I just executed the code from the command line... however thanks for the tip!

Andrea Z.

unread,
Jul 31, 2012, 1:22:56 AM7/31/12
to tas...@googlegroups.com
 uhm by console it works but inside tasker it seems not working...

ScottS

unread,
May 13, 2013, 9:57:51 AM5/13/13
to tas...@googlegroups.com
I've attempted this script, though it doesn't seem to be working.

Matt R

unread,
May 13, 2013, 7:32:15 PM5/13/13
to tas...@googlegroups.com
Do you have root access and busybox installed?

Matt

TomL

unread,
May 15, 2013, 10:19:57 AM5/15/13
to tas...@googlegroups.com
If you're having trouble, maybe you can try pasting the following into the command line instead:

busybox find /data/data -type d -iname "cache*" -exec busybox rm -f {}/ ';' -exec echo "Cleared {}" ';'

Be careful with making sure you don't miss any space characters.  Notice the lack of the #!/system/bin/sh line.

Tom

TomL

unread,
May 15, 2013, 10:59:35 AM5/15/13
to tas...@googlegroups.com
Just to be super clear, here's this line again:

busybox find /data/data -type d -iname "cache*" -exec busybox rm -f {}/ ';' -exec echo "Cleared {}" ';'

... with [SP] added in where you need a space character:

busybox[SP]find[SP]/data/data[SP]-type[SP]d[SP]-iname[SP]"cache*"[SP]-exec[SP]busybox[SP]rm[SP]-f[SP]{}/[SP]';'[SP]-exec[SP]echo[SP]"Cleared[SP]{}"[SP]';'


Tom

TaskerAholic

unread,
May 15, 2013, 11:42:31 AM5/15/13
to tas...@googlegroups.com
Very Kind, Tom


It seems "rm -f" option make a problem...


Thanks

2013년 5월 15일 수요일 오후 11시 59분 35초 UTC+9, TomL 님의 말:

Petr Menšík

unread,
Feb 6, 2014, 8:40:49 AM2/6/14
to tas...@googlegroups.com
I recomend Security Settings Tasker plugin  https://play.google.com/store/apps/details?id=com.intangibleobject.securesettings.plugin&hl=cs
You must buy full version(only in the plugin) and there is PRO action Package options - clear app cache, force close, unninstal, install etc.


Dne sobota, 17. března 2012 17:38:29 UTC+1 K.P. Smith napsal(a):

Yash Kumar

unread,
Feb 15, 2014, 2:16:53 PM2/15/14
to tas...@googlegroups.com
Just download this ultra small (19KB) app, it has no ui, just use the load app action in tasker, and open this app, all cache will be cleared.

Jay M

unread,
Feb 15, 2014, 2:56:59 PM2/15/14
to tas...@googlegroups.com

Secure settings can do this azwell IIRC

Jay M

On 15 Feb 2014 19:16, "Yash Kumar" <ykum...@gmail.com> wrote:
Just download this ultra small (19KB) app, it has no ui, just use the load app action in tasker, and open this app, all cache will be cleared.

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/groups/opt_out.

Yash Kumar

unread,
Feb 15, 2014, 10:53:20 PM2/15/14
to tas...@googlegroups.com
But secure Settings can only clear cache of one app at a time, you have to select the app, but this way you can clear all apps cache..

Bob Hansen

unread,
Feb 15, 2014, 10:56:54 PM2/15/14
to tas...@googlegroups.com
Yash,

You referred to "this ultra small app" do you have a link to the app?

Yash Kumar

unread,
Feb 15, 2014, 10:59:37 PM2/15/14
to tas...@googlegroups.com

Bob Hansen

unread,
Feb 15, 2014, 11:04:18 PM2/15/14
to tas...@googlegroups.com
Thanks for the link. 

I am sure I have forgotten things like that way more than you :>)

Scott S

unread,
Mar 17, 2014, 1:18:04 PM3/17/14
to tas...@googlegroups.com
This now seems to work for me, except I do get a dozen or so errors like the following...

rm: '/data/data/com.android.calendar/cache' is a directory

Bob Hansen

unread,
Mar 17, 2014, 1:24:27 PM3/17/14
to tas...@googlegroups.com
That would happen if there was nothing in the 'cache' folder.

Murilo Bellatini

unread,
Aug 4, 2014, 7:25:58 PM8/4/14
to tas...@googlegroups.com
Easier solution:

Download App Cache Cleaner. Go to Settings > Clear All (Auto clear all cached file when app starts).

Set new Task on Tasker: Launch App > App Cache Cleaner.

Place it on a Profile in order to set the trigger and that's it!

Sanket Jain

unread,
Mar 6, 2015, 3:45:58 PM3/6/15
to tas...@googlegroups.com, kps...@androidguy.net
Hey!
This clears cache of all the applications and only cache right?
Just confirming. :)

ultradj83

unread,
Apr 1, 2015, 1:17:50 AM4/1/15
to tas...@googlegroups.com
Dears,
what if I want to clear only Facebook's cache?

Do I just need to clear data/data/com.Facebook.katana/cache ?

Thanks a lot.

noob Gamer

unread,
Oct 31, 2019, 7:34:15 PM10/31/19
to Tasker
What command should i add so that it perfrom this task evry 5 second...and please also make a program to stop that after executing.. 
Reply all
Reply to author
Forward
0 new messages