0

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 Answers1

0

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.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • I am running python 2.7.10 and didn't change the check-import file at all. I installed the AndroidViewClient in the Android/sdk/tools/bin folder, where monkeyrunner and my python files are located, is that correct? Also I added "export ANDROID_VIEW_CLIENT_HOME=/Users/me/Library/Android/sdk/tools/bin/AndroidViewClient-master" to my bash_profile, are you saying I should remove that? – Arun Pingali Mar 04 '19 at 18:15
  • If you install `androidviewclient` with `pip` you don't need anything else, no environment variables, no extra downloads, etc. – Diego Torres Milano Mar 05 '19 at 07:11