javaandroidui-automationandroid-uiautomatoruidevice

Methods stubbed out in uiautomator.jar in android


I am using uiautomator APIs in my project. I found that uiautomator.jar has stubbed APIs while their implementation is present in sources under sdk folder.

public static UiDevice getInstance()
{
    throw new RuntimeException("Stub!");
}

What should I do now?


Solution

  • Since, UiDevice is a singleton class, I need to call getInstance()

    Call getUiDevice() on your UiAutomatorTestCase to get your UiDevice instance.