androidpythonadbandroidviewclient

How to Run Code on Android Generated by AndoirdViewClient?


Through the CulebraTester application on my device, I generated some python to simply open the settings application. When I went to run the script, I was greeted with

pkg_resources.DistributionNotFound: The 'androidviewclient<12.4.0' distribution was not found and is required by the application

So then I realized that I didn't have the environment variable set, so I downloaded the project from Github and ran the command

export ANDROID_VIEW_CLIENT_HOME=/path/to/androidviewclient/

I'm confident I did this correctly because I can cd to $ANDROID_VIEW_CLIENT_HOME and view the contents. Now when I go back to run the script this same error appears, so I commented out pkg_resources.require('androidviewclient>=12.4.0') and was then presented with this error

ImportError: No module named com.dtmilano.android.viewclient

Right now I'm clueless about what to do, I tried googling, but I've found nothing to fix the problem. Some-what related I saw a video on youtube where curl was used to run javascript generated by CulebraTester so maybe the same can be done with Python?


Solution

  • CulebraTester can generate tests in a variety of languages:

    see Code-Generation-language for details.

    Each language has its own dependencies in order to run, for example, if you generate UiAutomator tests in Java you will need the corresponding dependencies in your build.gradle.

    In your specific case, as you have generated Python tests you need androidviewclient. To install it, follow the instructions on AndroidViewClient: Installation