コードはとてもシンプルです
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
device = MonkeyRunner.waitForConnection()
device.touch(84, 712, "DOWN_AND_UP")
シミュレーターと私の SE Xperia Ray で実行しても問題ありませんが、
しかし、市場で販売されていない別のデバイスで実行すると。
エラーメッセージが飛び出します。
たとえば、「snapShot」を実行するなど、いくつかのコマンドを実行しても問題ありません。
しかし、「タッチ」「プレス」の場合は常に失敗しました。
一部のデバイスでは機能しなかったのはモンキールーナーのバグですか?
または問題はデバイスにあります。変更されたデバイスのソース コードに何らかの問題がある可能性があります。
インターネットで検索したのですが、これに対する解決策が見つかりません。
そして、デバイスでmonkeyruunerを使用するかどうかを決定する必要があります.
だから、私はいくつかの助けが必要です。
私の英語でごめんなさい:)
エラーログは
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] Error se
nding touch event: 84 712 DOWN_AND_UP
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice]java.net.
SocketException: Software caused connection abort: socket write error
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketOutputStream.socketWrite0(Native Method)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
net.SocketOutputStream.write(SocketOutputStream.java:136)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.n
io.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.n
io.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.n
io.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.n
io.cs.StreamEncoder.flush(StreamEncoder.java:122)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
io.BufferedWriter.flush(BufferedWriter.java:236)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.chimpchat.ChimpManager.sendMonkeyEventAndGetResponse(ChimpManager.java:18
6)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.chimpchat.ChimpManager.sendMonkeyEvent(ChimpManager.java:234)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.chimpchat.ChimpManager.tap(ChimpManager.java:329)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.chimpchat.adb.AdbChimpDevice.touch(AdbChimpDevice.java:361)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.monkeyrunner.MonkeyDevice.touch(MonkeyDevice.java:136)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.r
eflect.NativeMethodAccessorImpl.invoke0(Native Method)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.r
eflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at sun.r
eflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at java.
lang.reflect.Method.invoke(Method.java:597)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyReflectedFunction.__call__(PyReflectedFunction.java:175)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyObject.__call__(PyObject.java:355)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyMethod.__call__(PyMethod.java:215)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyMethod.instancemethod___call__(PyMethod.java:221)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyMethod.__call__(PyMethod.java:206)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyObject.__call__(PyObject.java:432)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyObject.__call__(PyObject.java:436)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.pycode._pyx0.f$0(d:\1234.py:18)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.pycode._pyx0.call_function(d:\1234.py)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyTableCode.call(PyTableCode.java:165)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.PyCode.call(PyCode.java:18)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.Py.runCode(Py.java:1197)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.core.__builtin__.execfile_flags(__builtin__.java:538)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at org.p
ython.util.PythonInterpreter.execfile(PythonInterpreter.java:156)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.monkeyrunner.ScriptRunner.run(ScriptRunner.java:116)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.monkeyrunner.MonkeyRunnerStarter.run(MonkeyRunnerStarter.java:77)
121129 10:56:42.227:S [main] [com.android.chimpchat.adb.AdbChimpDevice] at com.a
ndroid.monkeyrunner.MonkeyRunnerStarter.main(MonkeyRunnerStarter.java:189)