Ya every time I am not installing the App, just I will install Once and Reuse the same app. I hope My below code will be able to get the clear Idea. My Understanding about below code is, I will Just launch the app not going to install the app every run. If I am wrong please correct my understanding.
WebDriver drv;
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "DeviceName");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android"); capabilities.setCapability(CapabilityType.VERSION, "5.1.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("appPackage", "MyappAppPackage");
capabilities.setCapability("appActivity", "MyAppActivity");
drv = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);