Page 1 of 1

How to clear the app storage and cache?

Posted: Wed May 22, 2019 4:58 pm
by Aracknid
I saw this posting: https://www.ranorex.com/forum/viewtopic ... age#p46196 and I went to the user voice to add my input...

But in the meantime, how do you clear storage or clear cache for your app using adb commands or how can you write code to do it?

Thanks,

Aracknid

PS: Using Ranorex 9.0.1

Re: How to clear the app storage and cache?

Posted: Thu May 23, 2019 8:51 am
by McTurtle
Hi Aracknid,

You can do this with a "Run application" action by executing the right adb command. For example, for the RxBrowser:
ClearCache.png
Does it work for you?

Regards,
McTurtle

Re: How to clear the app storage and cache?

Posted: Thu May 23, 2019 4:03 pm
by Aracknid
Thanks McTurtle,

I wrote a code module to do the same thing you suggested. I had seen this solution on the web, but there was conflicting information from people. Some claimed it didn't work for them, others that it was no longer supported or was phone specific. I can say it worked for me with my Android Pixel 2 AVD.

Also, as I'm new to mobile testing and not really clear on it all and how it works... I was trying to avoid ADB if possible, but the more I get into this, the more I realize it's impossible to avoid ADB. Any reasonable testing solution of a mobile app will need to do a bunch of ADB calls to do various things.

I hope Ranorex creates some way to do this easily and documents the many common items people ask about and their solutions. For example, this and dealing with permission popups, copying files from device to local so you can access the data, etc...

I guess I should also mention this is Android specific. I haven't even touched iOS yet.... No idea about that platform yet.

Thanks,

Aracknid.

Re: How to clear the app storage and cache?

Posted: Fri May 24, 2019 2:35 pm
by McTurtle
Hi Aracknid,

Ranorex also uses ADB :) I guess its just too convenient.
Android is, in my opinion, more flexible than iOS. Courtesy of Apple...

Regards,
McTurtle