When I run my android UIAutomator code, it shows following error.
INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
INSTRUMENTATION_RESULT
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.
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.
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.
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.