App setting is changed each time after launching the APP

Hi,
I am able to launch the app which is already installed on my Android real device using the following code. But each time the app is launched the device ID in the APP is getting changed. Is there any way I can launch the app without resetting the App settings?

public class PushIo {

private static AndroidDriver driver;

public static void main(String[] args) throws MalformedURLException, InterruptedException {

	DesiredCapabilities capabilities = new DesiredCapabilities();
	//capabilities.setCapability(CapabilityType.BROWSER_NAME,"");
	capabilities.setCapability("deviceName", "Android Emulator");
	capabilities.setCapability("platformVersion", "5.1.1");
	capabilities.setCapability("platformName", "Android");
	capabilities.setCapability("appPackage", "com.pushio.testharness3");
	capabilities.setCapability("appActivity", "com.pushio.testharness1.MainActivity");
	driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
	driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
	driver.openNotifications();
	Thread.sleep(10000);
	driver.quit();
	

}

}

Try set noReset=true capability

1 Like

Thanks Degard, its working with your changes.

1 Like