【发布时间】:2012-02-28 23:06:37
【问题描述】:
我在 monkeyrunner 脚本中的 device.shell('ping -c 2 192.168.1.1') 中遇到了一些问题。
它的投掷
ShellCommandUnresponsiveException
[main] [com.android.chimpchat.adb.AdbChimpDevice]com.android.ddmlib.ShellCommandUnresponsiveException
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