2012-02-07 5 views
1

私はdevice.shell('ping -c 2 192.168.1.1')でmonkeyrunnerスクリプトの中にいくつかの問題に直面しています。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

あなたのping待機するだけ-tを追加-t 1

0

で-t

スタートを追加します。下の例は完璧に動作します!

device.shell('pm enable packageName -t 15') 
関連する問題