我在monkeyrunner脚本中遇到了device.shell('ping -c 2 192.168.1.1')中的一些问题。 它抛出以下错误: - 120202 20:12:17.192:S [main] [com.android.chimpchat.adb.AdbChimpDevice]执行命令时出错:ping -c 2 192.168.1.1
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
请看上面的脚本...... 有人请帮忙....