Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my python script that runs the adb shell monkey command crashing for large values of events?
    primarykey
    data
    text
    <p>I have written a small python function that runs an adb shell monkey -p -v command along with an adb logcat command using subprocess.popen. For values larger than 100, this program crashes and I'm not sure why.</p> <p>here is monkey_runner.py</p> <pre><code>import os, subprocess def run_monkey_process(package, num_commands): monkeycmd = "adb shell monkey -p " + package + " -v " + num_commands monkeyprocess = subprocess.Popen(monkeycmd, stdout=subprocess.PIPE) logcatcmd = "adb logcat" logcatprocess = subprocess.Popen(logcatcmd, stdout=subprocess.PIPE) monkeystring = monkeyprocess.communicate(input=None)[0] logcatstring = logcatprocess.communicate(input=None)[0] monkeyreturncode = monkeyprocess.poll() logcatreturncode = logcatprocess.poll() if(monkeyreturncode &gt;=0): monkeyprocess.kill() logcatprocess.kill() return monkeystring, logcatstring else: print 'command failure' return 'you', 'fail' </code></pre> <p>I can put my gui code here too, but it's nothing special.</p> <p>Here is the stacktrace</p> <pre><code>Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1470, in __call__ return self.func(*args) File "C:\Users\brandon.dalesandro\Desktop\Zonar\mankey\monkey_runner_gui.py", line 25, in goCallBack returned = run_monkey_process(package, num) File "C:\Users\brandon.dalesandro\Desktop\Zonar\mankey\monkey_runner.py", line 8, in run_monkey_process logcatstring = logcatprocess.communicate(input=None)[0] File "C:\Python27\lib\subprocess.py", line 798, in communicate stdout = _eintr_retry_call(self.stdout.read) File "C:\Python27\lib\subprocess.py", line 478, in _eintr_retry_call return func(*args) KeyboardInterrupt </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload