When i run my android UIAutomator code, it shows error

前端 未结 4 1289
情话喂你
情话喂你 2021-02-19 13:22

When I run my android UIAutomator code, it shows following error.

INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
INSTRUMENTATION_RESULT

相关标签:
4条回答
  • 2021-02-19 13:40

    Had the same problem. Most demos I've seen indicate to install the jar to /data/local/tmp/. I've seen others indicate to try and install it to your sd card (/storage/sdcard0). After doing that it worked. Seems to be a problem with read permissions.

    0 讨论(0)
  • 2021-02-19 13:41

    If you get a ClassNotFindException while running your uiautomator tests :

    Some of us my get this error because their ROM puts the folder /data/dalvik-cache in read-only mode. That happened to me with Cyanogen for a S3.

    In that case type, in bash :

    adb shell 
    su
    chmod 777 /data/dalvik-cache
    exit
    

    rerun your tests and that should work. As dalvik-cache is locked for apps, uiautomator can't ask dalvik to unzip the jar of your tests and dalvik won't find the its classes.

    0 讨论(0)
  • 2021-02-19 13:52

    See if removing the @UiThreadTest annotation or removing the runOnUiThread() call or re-factoring your tests work. But without a logcat, difficult to understand where it's coming from.

    0 讨论(0)
  • 2021-02-19 13:56

    I solved this error by using"ant build" to create my jar.If u use export in eclipse to create a jar file, there might be some errors in the resulting class file, hence the above class not found error.

    0 讨论(0)
提交回复
热议问题