Two things:
1) Closing sockets or waiting threads once you exit the application may
help.
2) To insure above happens you can try to stop the process (it will require
some special permission).


On Tue, Jul 1, 2014 at 12:03 AM, Diego Torres Milano <[email protected]>
wrote:

> Give AndroidViewClient/culebra
> <https://github.com/dtmilano/AndroidViewClient> a try. It handles the
> device connection better.
>
>
> On Sunday, 29 June 2014 23:48:43 UTC-4, wang nungchao wrote:
>>
>> Update:
>> My monkeyrunner script:
>>
>> import sys
>> from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
>>
>> device = MonkeyRunner.waitForConnection(1000,"HT3CJPNA0647")
>> device.wake()
>> while 1:
>> device.drag((400, 1400), (400, 400), 2, 10)
>> MonkeyRunner.sleep(3)
>> device.touch( 835, 1418, MonkeyDevice.DOWN)
>> MonkeyRunner.sleep(0.7)
>> device.touch( 834, 1417, MonkeyDevice.UP)
>> ....
>>
>> The exception happen in "device.drag"
>>
>> wang nungchao於 2014年6月30日星期一UTC+8上午11時44分16秒寫道:
>>>
>>> My device is HTC butterfly
>>> In Android 4.1, it never happen, but Android 4.3 sometime will happen.
>>>
>>> I run the same monkeyrunner script, sometime it has broken pipe
>>> exception, but sometime not.
>>> How can I fix this issue ? Or this is HTC or Android 4.3 issue ?
>>>
>>> The detail log:
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> Error sending drag start event
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> java.net.SocketException: Broken pipe
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.net.SocketOutputStream.socketWrite0(Native Method)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.io.BufferedWriter.flush(BufferedWriter.java:236)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.ChimpManager.sendMonkeyEventAndGetResponse(
>>> ChimpManager.java:187)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.ChimpManager.sendMonkeyEvent(
>>> ChimpManager.java:235)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.ChimpManager.touchDown(ChimpManager.java:88)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.adb.AdbChimpDevice$2.start(
>>> AdbChimpDevice.java:575)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.adb.LinearInterpolator.interpolate(
>>> LinearInterpolator.java:118)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.chimpchat.adb.AdbChimpDevice.drag(
>>> AdbChimpDevice.java:556)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at com.android.monkeyrunner.MonkeyDevice.drag(MonkeyDevice.java:174)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.reflect.NativeMethodAccessorImpl.invoke(
>>> NativeMethodAccessorImpl.java:39)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>>> DelegatingMethodAccessorImpl.java:25)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at java.lang.reflect.Method.invoke(Method.java:597)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at org.python.core.PyReflectedFunction.__call__(
>>> PyReflectedFunction.java:186)
>>> 140630 11:27:11.088:S [main] [com.android.chimpchat.adb.AdbChimpDevice]
>>> at org.python.core.PyObject.__call__(PyObject.java:345)
>>> 140630 11:27:11.088:S
>>>
>>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
Harsh Vardhan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to