I know the same question has been arise before and I tried all thing but nothing works.
I am using below code:
try {
DesiredCapabilities caps = new DesiredCapabilities();
// caps.setCapability(MobileCapabilityType.UDID, "ZX1G42CCXG");
caps.setCapability(MobileCapabilityType.DEVICE_NAME, "Nexus6");
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, "7.1.1");
caps.setCapability(MobileCapabilityType.AUTOMATION_NAME,
"uiautomator2");
caps.setCapability("noReset", true);
caps.setCapability("systemPort",4798 );
caps.setCapability("newCommandTimeout", 300);
// caps.setCapability("eventTimings", "true");
caps.setCapability("appPackage", "com.ebay.mobile");
caps.setCapability("appActivity","com.ebay.mobile.activities.MainActivity");
caps.setCapability("unicodeKeyboard", false);
driver = new AndroidDriver<MobileElement>(new URL(
"http://127.0.0.1:4723/wd/hub"), caps);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
// driver.close();
driver.closeApp();
driver.quit();
}
}
I have tried with Nexus 6 real device and Pixel2XL emulator.
I am attaching the snaphots also
I have one more question:
Q) In appium UI 6.0 is showing only, so is it mean appium only support upto 6.0. Where from I can get to know about the latest version and latest API level supported by appium
I have tried many thing like:
But nothing is working for me