I’m developing an automated testing process for an Android app that requires resetting the app to a consistent ground state between test sequences. The workflow is as follows:
- Start with the phone in a ground state
- Execute a series of test steps
- Automatically reset the app to its ground state
- Execute a different set of test steps
- Repeat
I’ve encountered challenges in automating the reset process (step 3). I can only access the app through adb.
Here are the approaches I’ve attempted so far:
- Replacing files in the data/data/<app_package> directory with a pre-saved reset state.
- Using the pm reset command.
- Tried backup using bmgr command (which doesn’t work for the particular apps, I am trying to automate: Samsung Contact, Samsung Accounts).
- Backup methods like titanium (can not be automated).
I can not switch the operating system. I have rooted my phone. Any insights will be greatly appreciated. Thank you in advance for your help.
SRBD TwentyFour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1