dtmilano / AndroidViewClient

Android ViewServer and ADB client
Apache License 2.0
1.62k stars 347 forks source link

androidviewclient problem with the setting. #77

Closed donenx closed 10 years ago

donenx commented 10 years ago

Hi I want use androidviewclient. What can i do? This is my problem: C:\Users\Donato Pastore>cd\

C:>cd AndroidViewClient

C:\AndroidViewClient>java -jar androidviewclient-2.3.24.jar dump 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] Script terminated due to an exception 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ]Traceback (most recent call last): File "C:\Users\Donato Pastore\dump", line 138, in vc = ViewClient(_ViewClient.connectToDeviceOrExit(__kwargs1), *_kwargs2) File "C:\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1390, in connectToDeviceOrExit ViewClient.setAlarm(timeout+5) File "C:\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1350, in setAlarm signal.alarm(timeout) File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\lib\jython-standalone-2. 5.3.jar\Lib\signal.py", line 222, in alarm NotImplementedError: alarm not implemented on this platform

140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyException.doRaise(PyException.java:219) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1239) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1243) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1247) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at signal$py.alarm$14(C:\adt-bundle-windows-x86_64-20131030\sdk\tools\li b\jython-standalone-2.5.3.jar\Lib\signal.py:239) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at signal$py.call_function(C:\adt-bundle-windows-x86_64-20131030\sdk\too ls\lib\jython-standalone-2.5.3.jar\Lib\signal.py) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.setAlarm$70(C:\AndroidViewClient\s rc\com\dtmilano\android\viewclient.py:1350) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient \src\com\dtmilano\android\viewclient.py) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.connectToDeviceOrExit$71(C:\Androi dViewClient\src\com\dtmilano\android\viewclient.py:1418) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient \src\com\dtmilano\android\viewclient.py) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:301) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.function_call(PyFunction.java:376) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:371) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:366) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyObject._callextra(PyObject.java:527) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.pycode._pyx0.f$0(C:\Users\Donato Pastore\dump:140) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.pycode._pyx0.call_function(C:\Users\Donato Pastore\dump) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyCode.call(PyCode.java:18) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.runCode(Py.java:1275) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.builtin.execfile_flags(builtin.java:522) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225 ) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter. java:77) 140415 15:33:19.664:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter .java:189)

C:\AndroidViewClient>

dtmilano commented 10 years ago

Upgrade to the latest AndroidViewClient version which is 100% python and does not depend on monkeyrunner or jython and you'll have no problems.

donenx commented 10 years ago

same problem... C:\AndroidViewClient-5.1.1>cd AndroidViewClient

C:\AndroidViewClient-5.1.1\AndroidViewClient>java -jar androidviewclient-2.3.24. jar dump 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] Script terminated due to an exception 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ]Traceback (most recent call last): File "C:\Users\Donato Pastore\dump", line 138, in vc = ViewClient(_ViewClient.connectToDeviceOrExit(__kwargs1), *_kwargs2) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\vi ewclient.py", line 1390, in connectToDeviceOrExit ViewClient.setAlarm(timeout+5) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\vi ewclient.py", line 1350, in setAlarm signal.alarm(timeout) File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\lib\jython-standalone-2. 5.3.jar\Lib\signal.py", line 222, in alarm NotImplementedError: alarm not implemented on this platform

140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyException.doRaise(PyException.java:219) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1239) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1243) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1247) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at signal$py.alarm$14(C:\adt-bundle-windows-x86_64-20131030\sdk\tools\li b\jython-standalone-2.5.3.jar\Lib\signal.py:239) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at signal$py.call_function(C:\adt-bundle-windows-x86_64-20131030\sdk\too ls\lib\jython-standalone-2.5.3.jar\Lib\signal.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.setAlarm$70(C:\AndroidViewClient-5 .1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py:1350) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient -5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.connectToDeviceOrExit$71(C:\Androi dViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py:1418)

140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient -5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:301) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.function_call(PyFunction.java:376) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:371) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:366) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyObject._callextra(PyObject.java:527) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.pycode._pyx0.f$0(C:\Users\Donato Pastore\dump:140) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.pycode._pyx0.call_function(C:\Users\Donato Pastore\dump) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyCode.call(PyCode.java:18) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.runCode(Py.java:1275) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.builtin.execfile_flags(builtin.java:522) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225 ) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter. java:77) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter .java:189)

C:\AndroidViewClient-5.1.1\AndroidViewClient>

dtmilano commented 10 years ago

Use just python 2.x, no java, no jar, no monkeyrunner, no jython...

On Tue, Apr 15, 2014 at 1:13 PM, donenx notifications@github.com wrote:

same problem... C:\AndroidViewClient-5.1.1>cd AndroidViewClient

C:\AndroidViewClient-5.1.1\AndroidViewClient>java -jar androidviewclient-2.3.24. jar dump 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions

] Script terminated due to an exception 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions

]Traceback (most recent call last): File "C:\Users\Donato Pastore\dump", line 138, in vc = ViewClient(_ViewClient.connectToDeviceOrExit(__kwargs1), *_kwargs2) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\vi

ewclient.py", line 1390, in connectToDeviceOrExit ViewClient.setAlarm(timeout+5) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\vi

ewclient.py", line 1350, in setAlarm signal.alarm(timeout) File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\lib\jython-standalone-2. 5.3.jar\Lib\signal.py", line 222, in alarm NotImplementedError: alarm not implemented on this platform

140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyException.doRaise(PyException.java:219) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1239) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1243) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.makeException(Py.java:1247) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions

] at signal$py.alarm$14(C:\adt-bundle-windows-x86_64-20131030\sdk\tools\li b\jython-standalone-2.5.3.jar\Lib\signal.py:239) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions

] at signal$py.call_function(C:\adt-bundle-windows-x86_64-20131030\sdk\too ls\lib\jython-standalone-2.5.3.jar\Lib\signal.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.setAlarm$70(C:\AndroidViewClient-5 .1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py:1350) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient -5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:134) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:317) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.connectToDeviceOrExit$71(C:\Androi

dViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py:1418)

140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.dtmilano.android.viewclient$py.call_function(C:\AndroidViewClient -5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyBaseCode.call(PyBaseCode.java:301) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.function_call(PyFunction.java:376) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:371) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyFunction.call(PyFunction.java:366) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyObject.

callextra(PyObject.java:527) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.pycode.pyx0.f$0(C:\Users\Donato Pastore\dump:140) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions

  • ] at org.python.pycode._pyx0.call_function(C:\Users\Donato Pastore\dump)*
  • 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyTableCode.call(PyTableCode.java:165) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.PyCode.call(PyCode.java:18) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core.Py.runCode(Py.java:1275) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.core._builtin.execfile_flags(_builtin*.java:522) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:225 ) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter. java:77) 140415 19:11:13.199:S [MainThread] [com.android.monkeyrunner.MonkeyRunnerOptions ] at com.android.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter .java:189)

C:\AndroidViewClient-5.1.1\AndroidViewClient>

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-40508200 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

donenx commented 10 years ago

ok, but when i run for example browser-open-url (a script python of androidviewclient in examples) , with this configuration "http://dtmilano.blogspot.it/2012/03/eclipse-working-monkeyrunner.html" i have this error in eclipse: Traceback (most recent call last): File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\workspace\pp\browser-open-url.py", line 33, in device, serialno = ViewClient.connectToDeviceOrExit() File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1391, in connectToDeviceOrExit device = adbclient.AdbClient(serialno) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\adb\adbclient.py", line 89, in init self.setTransport() File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\adb\adbclient.py", line 218, in setTransport raise RuntimeError("ERROR: couldn't find device that matches '%s'" % self.serialno) RuntimeError: ERROR: couldn't find device that matches '.*'

dtmilano commented 10 years ago

What's the output of adb devices ?

On Wed, Apr 16, 2014 at 4:14 PM, donenx notifications@github.com wrote:

ok, but when i run for example browser-open-url (a script python of androidviewclient in examples) , with this configuration " http://dtmilano.blogspot.it/2012/03/eclipse-working-monkeyrunner.html" i have this error in eclipse:

Traceback (most recent call last): File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\workspace\pp\browser-open-url.py", line 33, in device, serialno = ViewClient.connectToDeviceOrExit() File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1391, in connectToDeviceOrExit device = adbclient.AdbClient(serialno) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\adb\adbclient.py", line 89, in init self.setTransport() File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\adb\adbclient.py", line 218, in setTransport raise RuntimeError("ERROR: couldn't find device that matches '%s'" % self.serialno) RuntimeError: ERROR: couldn't find device that matches '.*'

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-40646413 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

donenx commented 10 years ago

i have changed the device and something work. I have only one problem . Why this error? Traceback (most recent call last): File "C:\adt-bundle-windows-x86_64-20131030\sdk\tools\workspace\avc2\settings-display.py", line 45, in vc = ViewClient(device, serialno)
File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1132, in init self.serialno = self.mapSerialNo(serialno) File "C:\AndroidViewClient-5.1.1\AndroidViewClient\src\com\dtmilano\android\viewclient.py", line 1312, in mapSerialNo raise ValueError("Regular expression not supported as serialno in ViewClient") ValueError: Regular expression not supported as serialno in ViewClient

donenx commented 10 years ago

C:>adb devices List of devices attached BX902EVPWD device

dtmilano commented 10 years ago

I tested the same script and it works, despite some minor errors that I corrected. Patch also uploaded. How are you invoking the script?

$ ./settings-display.py

and

$ ./settings-display.py 00.*

both worked for me (with multiple devices connected).

On Wed, Apr 16, 2014 at 5:28 PM, donenx notifications@github.com wrote:

C:>adb devices List of devices attached BX902EVPWD device

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-40654574 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

donenx commented 10 years ago

Hi Diego thanks, work also for me. I have another question for you.. There is a way for view a list of all default activity of my device? For example com.android.settings or com.android.mms

dtmilano commented 10 years ago

$ adb shell pm list packages

prints the list of packages, I guess this is what you want,.

On Thu, Apr 17, 2014 at 10:05 AM, donenx notifications@github.com wrote:

Hi Diego thanks, work also for me. I have another question for you.. There is a way for view a list of all default activity of my device? For example com.android.settings or com.android.mms

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-40717271 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

donenx commented 10 years ago

is there a way to make the touch of these items? android.view.View id/no_id/29 <------ this android.widget.TextView id/no_id/30 Carico android.widget.LinearLayout id/no_id/31 <-------this android.widget.TextView id/no_id/32 Nessuna scheda SIM

dtmilano commented 10 years ago

vc.findViewByIdOrRaise('id/no_id/29').touch()

On Fri, Apr 18, 2014 at 5:22 AM, donenx notifications@github.com wrote:

is there a way to make the touch of these items? android.view.View id/no_id/29 <------ this android.widget.TextView id/no_id/30 Carico android.widget.LinearLayout id/no_id/31 <-------this android.widget.TextView id/no_id/32 Nessuna scheda SIM

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-40797587 .

Have you read my blog ? http://dtmilano.blogspot.com android junit tests ui linux cult thin clients

donenx commented 10 years ago

when i run this method, it's all ok ... def test() : package='com.android.settings' activity='.Settings' component=package + "/" + activity device, serialno = ViewClient.connectToDeviceOrExit() device.startActivity(component=component)

but if i want run it, for example with the package:/system/app/GoogleEarth.apk=com.google.earth whit this code

def test() :

package = 'com.google.earth'
activity = 'GoogleEarth'
component = package + "/" + activity

device, serialno = ViewClient.connectToDeviceOrExit()
device.startActivity(component=component)

i have this Error: Activity class {com.google.earth/GoogleEarth} does not exist.

dtmilano commented 10 years ago

Missing '.'? On Apr 27, 2014 5:23 PM, "donenx" notifications@github.com wrote:

when i run this method, it's all ok ... def test() : package='com.android.settings' activity='.Settings' component=package + "/" + activity device, serialno = ViewClient.connectToDeviceOrExit() device.startActivity(component=component)

but if i want run it, for example with the package:/system/app/GoogleEarth.apk=com.google.earth whit this code

def test() :

package = 'com.google.earth' activity = 'GoogleEarth' component = package + "/" + activity

device, serialno = ViewClient.connectToDeviceOrExit() device.startActivity(component=component)

i have this Error: Activity class {com.google.earth/GoogleEarth} does not exist.

— Reply to this email directly or view it on GitHubhttps://github.com/dtmilano/AndroidViewClient/issues/77#issuecomment-41509661 .

yourng2794 commented 9 years ago

logo@logo:~/CTS/AndroidViewClient-master$ ./Deviceadmin.py Traceback (most recent call last): File "./Deviceadmin.py", line 43, in vc = ViewClient(device=device, serialno=serialno) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-10.5.1-py2.7.egg/com/dtmilano/android/viewclient.py", line 2324, in init self.serialno = self.mapSerialNo(serialno) File "/usr/local/lib/python2.7/dist-packages/androidviewclient-10.5.1-py2.7.egg/com/dtmilano/android/viewclient.py", line 2466, in mapSerialNo raise ValueError("Regular expression not supported as serialno in ViewClient. Found '%s'" % serialno) ValueError: Regular expression not supported as serialno in ViewClient. Found 'adb server is out of date. killing...

dtmilano commented 9 years ago

If your intention is to use regular expressions for the serial numbers you should use ViewClient.connectToDeviceOrExit() as culebra generated scripts do:

...
kwargs1 = {'ignoreversioncheck': False, 'verbose': False, 'ignoresecuredevice': False}
device, serialno = ViewClient.connectToDeviceOrExit(**kwargs1)
kwargs2 = {'compresseddump': True, 'startviewserver': True, 'forceviewserveruse': False, 'autodump': False, 'ignoreuiautomatorkilled': True}
vc = ViewClient(device, serialno, **kwargs2)
...

in this case the serial number, which can be a regular expression is taken from the script command line

example.py 0.*

will attempt to connect to a device with serial number starting with 0.

If you don't want this, you can always specify the serialno in your call as in

device, serialno = ViewClient.connectToDeviceOrExit(serialno='0.*', **kwargs1)
dtmilano commented 9 years ago

Also, please create new issues or StackOverflow questions at http://stackoverflow.com/questions/tagged/androidviewclient, not just add unrelated comments to closed issues.