Can't get AndroidViewClient example code to run
Question: [AndroidViewClient](https://github.com/dtmilano/AndroidViewClient) is a github
repo that allows you to call on views directly, without specifying exact
coordinates with monkeyrunner. I'm having trouble actually using it though.

_Note: I'm using Windows_

In cmdline if I type:

    
    
    monkeyrunner test.py
    

and test.py consists of:

    
    
    # Imports the monkeyrunner modules used by this program
    from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
    
    # Connects to the current device, returning a MonkeyDevice object
    device = MonkeyRunner.waitForConnection()
    
    # Presses the Menu button
    device.press('KEYCODE_MENU', MonkeyDevice.DOWN_AND_UP)
    

Then the actionBar overflow button get's clicked.

If I edit test.py to any of the AndroidViewClient examples it will doesn't do
anything.

Any ideas? I'm not sure if I'm implementing AndroidViewClient correctly.

**EDIT:**

The only thing I did to setup AndroidViewClient is download the .zip from
github and then I added it to my environment variables like this:

![enter image description here](http://i.stack.imgur.com/Flbt2.png)

When I try to run `monkeyrunner dump.py`:

    
    
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions] Scri
    pt terminated due to an exception
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]Trace
    back (most recent call last):
      File "C:\Users\EgamerHDK\android-sdk\tools\dump.py", line 29, in <module>
        from com.dtmilano.android.viewclient import ViewClient
    ImportError: No module named dtmilano
    
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.Py.ImportError(Py.java:264)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.imp.import_logic(imp.java:692)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.imp.import_name(imp.java:746)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.imp.importName(imp.java:791)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.ImportFunction.__call__(__builtin__.java:1236)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.PyObject.__call__(PyObject.java:367)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.__builtin__.__import__(__builtin__.java:1207)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.imp.importFromAs(imp.java:869)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.imp.importFrom(imp.java:845)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.pycode._pyx0.f$0(C:\Users\EgamerHDK\android-sdk\tools\dump.py:78)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.pycode._pyx0.call_function(C:\Users\EgamerHDK\android-sdk\tools\dump.
    py)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.PyTableCode.call(PyTableCode.java:165)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.PyCode.call(PyCode.java:18)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.Py.runCode(Py.java:1197)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.core.__builtin__.execfile_flags(__builtin__.java:538)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:156)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:77)
    
    130419 02:46:57.869:S [main] [com.android.monkeyrunner.MonkeyRunnerOptions]
    at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:18
    9)
    

**Typing in the full path:**

    
    
    C:\Users\EGamerHDK\android-sdk\tools>monkeyrunner C:\AndroidViewClient-master\Andro
    idViewClient-master\AndroidViewClient\examples\dump.py
    Can't open specified script file
    Usage: monkeyrunner [options] SCRIPT_FILE
    
        -s      MonkeyServer IP Address.
        -p      MonkeyServer TCP Port.
        -v      MonkeyServer Logging level (ALL, FINEST, FINER, FINE, CONFIG, INFO,
    WARNING, SEVERE, OFF)
    


Answer: From [AndroidViewClient
wiki](https://github.com/dtmilano/AndroidViewClient/wiki):

> Installation AndroidViewClient does not require installation to be used. You
> only need to download the source distribution and set the environment
> variable ANDROID_VIEW_CLIENT_HOME or PYTHONPATH to allow the monkeyrunner
> interpreter to find the required modules.

Expand the downloaded ZIP file and set the environment variable accordingly.

Then if you are intending to run, for example `dump.py` the next step is:

    
    
    monkeyrunner dump.py
    

