AndroidViewClient icon indicating copy to clipboard operation
AndroidViewClient copied to clipboard

Cant Run AndroidViewClient

Open Inubaka opened this issue 12 years ago • 2 comments

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 vc = ViewClient(*ViewClient.connectToDeviceOrExit()) File "C:\Android\adt-bundle-windows-x86_64-20130219\sdk\tools\AndroidViewClient\src\com\dtmilano\a ndroid\viewclient.py", line 958, in init adb = ViewClient.__obtainAdbPath() File "C:\Android\adt-bundle-windows-x86_64-20130219\sdk\tools\AndroidViewClient\src\com\dtmilano\a ndroid\viewclient.py", line 1100, in _ViewClient__obtainAdbPath raise Exception('adb="%s" is not executable. Did you forget to set ANDROID_HOME in the environme nt?' % adb) Exception: adb="adb.exe" is not executable. Did you forget to set ANDROID_HOME in the environment?

Inubaka avatar May 16 '13 20:05 Inubaka

It seems ANDROID_HOME is not set in the environment, at least it's what the error says.

dtmilano avatar May 17 '13 06:05 dtmilano

Perhaps commit 62d5626e54274aa3c5ecf54b648bc2fbf2f13ae7 solves your problem. You can give the lastest version a shot.

dtmilano avatar Jun 06 '13 02:06 dtmilano