I have to automate an Android application, I am doing the same through Appium.
The problem I am facing is after launching the Appium server, the app is getting instal
I got it resolved
I closed the Appium Server running on my machine and opened it again. Later open uiautomater, and it worked for me
Way to bypass the ERROR:
could not get idle state.
By using uiautomator to get uix and screenshot.
public class DeviceMethods extends UiAutomatorTestCase {
public void dump(){
try {
getUiDevice().dumpWindowHierarchy("window_dump.uix") ;
getUiDevice().takeScreenshot(new File("/data/local/tmp/window_dump.png"));
} catch (Exception e) {
}
}
you need to create the uiautomator jar and push it to /data/local/tmp
use this tutorial on how to use uiautomator
after you get the files just open them in uiautomatorviewer
I got also the same issue (Also if Appium Server was not running). After switch, OFF / ON USB-Debugging was working for me.
Stop the Appium Server. Then try again. It works.
This happens because adb is using port and it's blocked by appium server.
I have found out best solution for this
Kill the adb.exe from taskbar processes and try launching uiautomatorviewer again
we have to use device which has API level morethan 17 or jelly bean