Reinstall app at start of testsuite

I am using Java with TestNG framework

Any Best Practice to make sure that the app is reinstalled when starting an Appium session / Test Suite , so the tests are not performed on a previous (already installed on device) version of the app.

My capability “NoReset” is set on ‘true’, to make sure that the app is not reinstalled between tests/methods.

You could write a cleanup method that includes driver.removeApp(bundleId). Running it at the end of your tests should ensure that you always start out with a clean testing environment.

@ManDD Normally i do 1 test with fresh client install in suite. i am setting it as parameter in testNG xml. final code to open driver is:

                if (devicePlatform.contains("fullReset")) { // reinstall client
                    System.out.println("  Driver DO FULL-RESET");
                    capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
                    capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
                } else if (devicePlatform.contains("fastReset")) { // clears cache without reinstall
                    System.out.println("  Driver DO FAST-RESET");
                    capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
                    capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
                } else {
                    System.out.println("  Driver DO NORMAL start");
                    capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
                    capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
                }