How to set the environmental variable for AndroidViewClient?

352 Views Asked by At

I have monkeyrunner set up and am trying to set up AndroidViewClient as well. I followed the tutorial at https://github.com/dtmilano/AndroidViewClient/wiki, doing a pip install, and added the env path to my bash profile using the code:

export ANDROID_VIEW_CLIENT_HOME=/Users/me/Library/Android/sdk/tools/bin/AndroidViewClient-master

I made sure to re-source my bash. However, when I run python check-import.py --debug from the /examples folder, I receive the error:

File "check-import.py", line 22
    print("WARNING: '%s' is not a directory and is pointed by ANDROID_VIEW_CLIENT_HOME environment variable" % avcd, file=sys.stderr)
                                                                                                                         ^
SyntaxError: invalid syntax

I'm not very familiar with environmental variables so I could have easily made a mistake that I didn't catch.

1

There are 1 best solutions below

2
Diego Torres Milano On

If you installed androidviewclient via pip like

pip install androidviewclient

and it didn't give you any errors, then androidviewclient should be installed and available to your scripts via import or command line via its commands (i.e. dump, culebra).

You don't need any environment variables.

Then when you run

./check-import.py --debug

you will see your python path printed and then

OK

It seems you have changed this line https://github.com/dtmilano/AndroidViewClient/blob/master/examples/check-import.py#L22

AndroidViewClient/culebra requires python 2.7.x, so if you have a different version on your system you can install https://github.com/pyenv/pyenv or other virtual environment.