Appium starting chrome instead of launching App

I am using following simple code to invoke already existing app on Samsung S5:

File classpathRoot = new File(System.getProperty("user.dir"));
 	File appDir 	= new File(classpathRoot, "\\lib");
	File app 		= new File(appDir, "xxxxx.apk");
	DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("platformName", "Android");
    capabilities.setCapability("platformVersion", "4.4");
    capabilities.setCapability("deviceName", "Samsung S5");
    //capabilities.setCapability("app", app.getAbsolutePath());
    capabilities.setCapability("autoLaunch", true);
    capabilities.setCapability("udid", "320821e688eb6123");
    capabilities.setCapability("appPackage", ""); 
    capabilities.setCapability("appActivity", ".xxx"); 
    try {
    	WebDriver driver = new RemoteWebDriver(new URL(""), capabilities);
	} catch (MalformedURLException e) {

This code peice is invoking chrome browser instead of launching the android app. What’s wrong?

 info: Client User-Agent string: Apache-HttpClient/4.3.6 (java 1.5)

info: Set mode: Proxying straight through to Chromedriver
info: [debug] Looks like we want chrome on android
info: [debug] Creating new appium session 2d53c91f-743e-48d3-8b17-9b541c020545

@Khushboo_Kaur add the below line in capabilities
capabilities.setCapability(CapabilityType.BROWSER_NAME, “”);

1 Like