When i run my android UIAutomator code, it shows error When i run my android UIAutomator code, it shows error android android

When i run my android UIAutomator code, it shows error


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 suchmod 777 /data/dalvik-cacheexit

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.


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.