Want to clear storage or cache for ios App .tried driver.resetApp but it is not working

Want to clear storage or cache for ios App during execution.
Tried driver.resetApp() but it is not working but same is working for Android platform.
Can anybody suggest some other workaround for the same.

1 Like
  1. if you manually clear cache and storage on app will it work?
  2. did you try simple adb command ?
adb shell pm clear packageName

can you please help me for iOS platform… On Android driver.resetApp is working fine for me

You can add Capability fullReset=true and then restart driver. Reset strategies here:

https://appium.io/docs/en/writing-running-appium/other/reset-strategies/index.html

1 Like

There is no way to do that on real iOS devices without full application reinstall. Having a special backdoor for cache reset in the app under test might also work as a possible workaround

with iOS only app reinstall and ONLY if app does not have some other functionality e.g. restore it data by e.g. device ID which does not change.

thanks to both for your reply. I have tried fullReset =true and then that app disappears from the device. How to install that app again programatically?

To use the fullReset capability you are going to have to stop the driver and then when you start it again the app will install as normal.

Is there any other way except of fullReset=true and restart of the driver?
If I do this - my cloud provider releases the phone and starts a long cleanup process.
Next test starts the dirver - and need to wait till the phone is cleaned up and back avaliable again…

I would check with your provider for options. Explain what you are trying to do, often these are common problems and they may have a strategy.