Reputation: 1
I'm trying to configure a real device with appium using eclipse IDE for testing purpose. Attaching CalculatorTest.java class in which I'm trying to linked a real time mobile device and opens up Calculator application on the mobile device. Mobile device is being accessed through data cable using Vysor application.
Getting UiAutomator exited unexpectedly with code 0, signal null error in Appium Server log. Attaching it's log also. appium server log
package appiumtests;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
public class CalculatorTest {
static AppiumDriver<MobileElement> driver;
public static void main(String[] args) {
try {
openCalculator();
System.out.println("try ended");
}catch (Exception exp) {
System.out.println("Exception 1");
System.out.println(exp.getCause());
System.out.println("Exception 2");
System.out.println(exp.getMessage());
System.out.println("Exception 3");
exp.printStackTrace();
}
}
public static void openCalculator() throws MalformedURLException {
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("deviceName", "SM-A52s 5G");
cap.setCapability("udid", "R5CRB1N2LWY");
cap.setCapability("platformName", "Android");
cap.setCapability("platformVersion", "12");
cap.setCapability("appPackage", "com.sec.android.app.popupcalculator");
cap.setCapability("appActivity", "com.sec.android.app.popupcalculator.Calculator");
String baseURL = "http://0.0.0.0:";
String minorURL = "/wd/hub";
String port = "4723";
URL url = new URL(baseURL+port+minorURL);
System.out.println("before AppiumDriver<MobileElement>");
driver = new AppiumDriver<MobileElement>(url, cap);
System.out.println("Application Started....");
}
}
pom.xml file has following code:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>appiumtests</groupId>
<artifactId>appiumtests</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>sample appium project</description>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.appium/java-client -->
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>7.3.0</version>
</dependency>
</dependencies>
</project>
I've followed Getting UiAutomator exited unexpectedly with code 0, signal null error but it did not help me to resolve the issue. Any help will be highly appriciated.
FYI Pre-requisites installed on my system are:
Upvotes: 0
Views: 815
Reputation: 94
This UiAutomator exited unexpectedly with code 0, signal null" error means that driver is currently not able to decide what device driver supports ,
just add this to your capability code ,
"automationName": "UiAutomator2",
Upvotes: 1
Reputation: 33
Sometime using UiAutomator when appium server is running creates issue, can you stop appium server then open UiAutomator.
Upvotes: 0