Why install app.every time if app.Already there in device

Hi sir,
I am doing a mobile app. automation using appium studio . I noticed that every time takes app. I need to call my login function always.
Is there any way that it does not install the app. from the path if the app. is already installed? and also open the app with the current screen?

Hi Sridhar,

I am not sure if installs every-time even if its installed in the mobile device. But in any case this is more of a question on Appium Libraries than Appium Studio.

Check this - http://appium.io/docs/en/writing-running-appium/other/reset-strategies/index.html , may be you should try noReset parameter in capabilities.

Just don’t set up the path of the APK / IPA file and set the noReset parameter as suggested.

That would be the OpenQA.Selenium.Appium.Enums.MobileCapabilityType.App and OpenQA.Selenium.Appium.Enums.MobileCapabilityType.NoResetparameter in C#. I use a little if statement:

            if (install)
                options.AddAdditionalCapability (
                options.AddAdditionalCapability (
                    capabilityValue: true);

thank you sir, how its work in java , i am working in java project

AddAdditionalCapability is probably spelled addAdditionalCapability.

BTW: I’m not working for experitest — I’m not getting payed to translate C# into Java code for you.

Hello Sudhir,

Please check this, again this is not Experitest library but Appium library which Appium Studio supports
As mentioned please check http://appium.io/docs/en/writing-running-appium/other/reset-strategies/index.html. As an example
You set noReset like any other capability,
DesiredCapabilities dc = new DesiredCapabilities();
dc.setCapability(MobileCapabilityType.NO_RESET, true);

Sir , This is my script can you modify me please sir

public void setUp() throws MalformedURLException {
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability(“platformName”, “Android”);
desiredCapabilities.setCapability(“platformversion”, “8.0.0”);
desiredCapabilities.setCapability(“deviceName”, “XUV3Y18725041617”);

desiredCapabilities.setCapability("app", "D:\\App\\app-release_2_29_103_prod.apk");

// desiredCapabilities.setCapability(“app”, “D:\App\app-release_2_25_98_prod.apk”);

desiredCapabilities.setCapability("appPackage", "com.mobile.producersonline");
desiredCapabilities.setCapability("appActivity", "com.mobile.producersonline.SplashActivity");

URL remoteUrl = new URL("http://localhost:4723/wd/hub");

driver = new AndroidDriver(remoteUrl, desiredCapabilities);
driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);

// private void setCapability(String string, String string2) {
// TODO Auto-generated method stub


I think Appium Does not provide any capability flag where you can specify “launch” only if the app is installed in the device.

You can do the following…

Run your program in install and launch mode when you want it to install and launch.
In this case, you provide the path in “app” desired like this desiredCapabilities.setCapability(“app”, “D:\App\app-release_2_25_98_prod.apk”);

In case of launch only mode do not provide “app” capability but only provide
dc.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, “com.experitest.ExperiBank”); dc.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, “.LoginActivity”);
dc.setCapability(MobileCapabilityType.NO_RESET, true);
dc.setCapability(“fullReset”, false);

Hope this helps.
Alternatively, if you want to be more programmatic you can use java to execute adb shell pm list packages and parse and find out if the package is installed and if not then use “app” capability or if already installed then just run in Launch mode.