2012-02-07 45 views
1

我正在面對monkeyrunner腳本中的device.shell('ping -c 2 192.168.1.1')中的一些問題。 它扔MonkeyRunner拋出「ShellCommandUnrespo nsiveException」 - 任何解決方法?

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 

請參見上面的腳本。我怎樣才能解決這個問題?

回答

0

你的平等待長

添加-t

開始與-t 1

0

只需添加-t。下面的例子非常完美!

device.shell('pm enable packageName -t 15') 
相關問題