driver.resetApp and accounts data

As part of automating our android application there is a need to reset the app data (cache + account data). I noticed that there is driver.resetApp function that can be used for this purpose. It clears the app cache and preferences but it does not clear the account data, to be more specific the account data lives under Settings -> Accounts and our app.

We store the login credentials here for the user so that the user does not have to automatically login into our app.
This means that when the next test runs the user is already logged in and the test fails.

We can certainly use the fullReset capability but this would be our final option.
Can someone please let us know if it is possible to clear the data using appium API or adb shell?

Thank you
Haroon

why not to use fastReset option? -> Different capabilities for different scenarios

fastReset does not clear the accounts data. i.e. lets say you have set up a Gmail account on the android phone and the account details are stored in the Android Phone Settings > Accounts.

Correct me if I am wrong but as per my understanding appReset and fastReset would reset the app preferences but not the data under the accounts.

But fullReset will not erase your gmail account also. It will just uninstall and install app under test. FastReset way is just reset app under test data.

Maybe look for emulator?

emulator -avd Your_Device_Name -wipe

sorry for the confusion, I don’t want to delete the gmail account… it was just an example. credentials for our app our stored under Settings > Accounts on the phone and resetApp or fastReset don’t do anything with the account section.

emulator wipe-date command only works if the emulator is shutdown, cant do on a running instance. may be for now we will just go with fullReset

thank you for your time.

ok. try look for adb -> https://developer.android.com/studio/command-line/adb.html#shellcommands :slight_smile:

  • clear package
  • remove-user user_id