Pulling out my hair..hum..UIAutomator/UIAutomator2 issue?


Windows 7 / Node v8.10.0
Installed appium “npm install -g appium”
Appium version - 1.7.2

The server is running…
[Appium] Welcome to Appium v1.7.2
[Appium] Appium REST http interface listener started on

Android Real Device - Android Version 6.0.1

appium-dotnet-driver that I am using…

com.my.test is just simple blank android activity application has one button for testing…
This app has been deployed on my device.

Here is the code that I am using

        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.SetCapability(MobileCapabilityType.DeviceName, "MyDeviceName");
        //capabilities.SetCapability(MobileCapabilityType.AutomationName, "UiAutomator2");
        capabilities.SetCapability(MobileCapabilityType.PlatformName, "Android");
        capabilities.SetCapability(AndroidMobileCapabilityType.AppPackage, "com.my.test");
        capabilities.SetCapability(AndroidMobileCapabilityType.AppActivity, ".MainActivity");
        AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(capabilities);
        var button = driver.FindElement(By.Id("com.my.test:id/tButton"));

If I DIDN’T specify automation name in the capabilities, the error I am seeing is that…
[UiAutomator] UiAutomator exited unexpectedly with code 0, signal null"

If I specified automation name with “UiAutomator2” in the capabilities, the error I am seeing is that…
It throws timed out…
[UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online…
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8204/wd/h
ub/status] with no body
– Printing multiple times above message…for the status ping .then eventually …timed out…

It looks like it was trying to connect …but never …
BTW, on my phone, I am seeing two apps installed by appium automatically.

io.appium.uiautomator2.server (v0.3.0)

Any idea what could be issue here???

P.S : BTW, I am seeing my android app actually running on my device by running my client program… so when it tries to send command to the server to find the element, I guess, uiautomator/or uiautomator2 kicks in to find the ui element by that…but at this point, it causes the errors… I tried to reboot my phone several times…and even tried to re-install the appium server several times…also, I tried setting timeout value long enough, but no luck…

Update: another error messages

[debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.my.test:id/tButton”,“context”:"",“multiple”:false}}
[MJSONWP] Encountered internal error running command: Error: Android bootstrap socket crashed: Error: This socket has been ended by the other party

Update2: I suspected the .NET client…so I tried with Java client…however, this also has exactly same issue like I described here… 1.7.2 appium server is not stable? Should I use different version of the server? or For this kinds of simple testing, rooted is required??? I don’t believe so though…

Thanks in advance.