Cant Run AndroidViewClient
Hi Diego,
I am new in Android development and testing and I am trying to use AndroidViewClient for the first time and I followed the steps you have and kept getting an error, could you suggest me how I solve this?
I am using Emulator and have setup ANDROID_HOME, ANDROID_VIEW_CLIENT_HOME to ..\sdk\platform-tools\ and ..\sdk\tools\AndroidViewClient
and the code I used "import re import sys import os
try: for p in os.environ['PYTHONPATH'].split(':'): if not p in sys.path: sys.path.append(p) except: pass
try: sys.path.append(os.path.join(os.environ['ANDROID_VIEW_CLIENT_HOME'], 'src')) except: pass
Imports the monkeyrunner modules used by this program
from com.dtmilano.android.viewclient import ViewClient, ViewNotFoundException from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice from com.android.monkeyrunner.easy import EasyMonkeyDevice from com.android.monkeyrunner.easy import By
print "Launching application again"
device.startActivity(component=runComponent)
vc = ViewClient(*ViewClient.connectToDeviceOrExit())"
Errors which I got when running C:\Android\adt-bundle-windows-x86_6420130219\sdk\tools>monkeyrunner -plugin androidviewclient-2.3.16.jar c:\Android\SampleApps\MonkeyRunnerExample\Main.py
C:\Android\adt-bundle-windows-x86_6420130219\sdk\tools\AndroidViewClient\src\com\dtmilano\android\v
iewclient.py:1135: UserWarning: Running on emulator but no serial number was specified then 'emulator-5554' is used warnings.warn("Running on emulator but no serial number was specified then 'emulator-5554' is used")
130516 15:30:08.761:S [MainThread] com.android.monkeyrunner.MonkeyRunnerOptions] Script terminated due to an exception
130516 15:30:08.761:S [MainThread][com.android.monkeyrunner.MonkeyRunnerOptions]Traceback (most rec
ent call last):
File "c:\Android\SampleApps\MonkeyRunnerExample\Main.py", line 25, in
It seems ANDROID_HOME is not set in the environment, at least it's what the error says.
Perhaps commit 62d5626e54274aa3c5ecf54b648bc2fbf2f13ae7 solves your problem. You can give the lastest version a shot.