Uninstalling the application during testing

I am new to Android testing with Robotium. How can I programmatically uninstall and then install the application before running some tests?

For example, to check the login action, I need to make sure that the login credentials are not saved from the previous application launch. Or is there another way to do this?

+4
source share
2 answers

You can use the following code snippet (on the machine you are debugging from) to remove the application:

Runtime rt = Runtime.getRuntime(); Process pr = rt.exec("adb uninstall your.package"); pr.waitFor(); 
+6
source

-You can also do this using UIAutomator -Install the application from the play store when starting the test and uninstall it after the test is completed. -She will always install the new version from the play store.

0
source

Source: https://habr.com/ru/post/1384743/


All Articles