How to remove the application once the test is completed?

I am using Xamarin UI Test for my Android test project, I would like to know the possibility of removing the application once my tests are completed? ( In a Tear down method )

Tagged:

Answers

  • ChaseFlorellChaseFlorell CAInsider, University mod

    are you talking about locally or in TestCloud?
    I don't know about the magic that happens in TestCloud, but locally you can run a cmd.

    > adb uninstall my.app.name
    
  • JuanPabloSillerJuanPabloSiller USMember ✭✭

    If you want to set the application to an initial state, for Xamarin Test Cloud only you can use the following:
    StartApp(AppDataMode.Clear);

    For iOS to uninstall the app locally in the emulator between each test I use:
    var uninstallProcess = System.Diagnostics.Process.Start("xcrun", "simctl uninstall booted com.bcycle.mobileapp");
    uninstallProcess.WaitForExit();

    For Android, it must be something similar, running the adb process as Chase suggested.

Sign In or Register to comment.