【问题标题】:Monkeyrunner throwing "ShellCommandUnrespo​nsiveException" - any work around?Monkeyrunner 抛出“ShellCommandUnrespo​nsiveException” - 有什么解决方法吗?
【发布时间】:2012-02-28 23:06:37
【问题描述】:

我在 monkeyrunner 脚本中的 device.shell('ping -c 2 192.168.1.1') 中遇到了一些问题。 它的投掷

ShellCommandUnrespo‌​nsiveException 
[main] [com.android.chimpchat.adb.AdbChimpDevice]com.android.ddmlib.ShellCommandUnrespo‌​nsiveException 
while (count<1000) :
device.shell('dmesg -c')
print '****swithing OFF wifi in loop NO-',count
device.touch(400,155,MonkeyDevice.DOWN_AND_UP)
time.sleep(10)
print '****switching ON wifi in loop NO-',count
device.touch(400,155,MonkeyDevice.DOWN_AND_UP)
time.sleep(25)
fd=open('pingstats.txt','a+b')
fd.write('***Loop-%i \n************\n%s\n****************\n' % (int(count),ping))
ping = device.shell('ping -c 2 192.168.1.1')
status=re.search('unreachable',ping)
if status:
    dmesg=device.shell('dmesg')
    fd.write(logcat)
fd.close()
count = count + 1

请参阅上面的脚本。我该如何解决这个问题?

【问题讨论】:

    标签: adb python-2.7 monkeyrunner android-sdk-1.6 jython-2.5


    【解决方案1】:

    您的 ping 等待时间很长

    添加一个-t

    从 -t 1 开始

    【讨论】:

      【解决方案2】:

      只需添加 -t 即可。下面的示例完美运行!

      device.shell('pm enable packageName -t 15')
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-11-13
        • 2017-10-23
        • 2014-11-14
        • 2021-09-02
        • 2019-07-03
        • 2023-03-10
        • 1970-01-01
        相关资源
        最近更新 更多