
# -*- coding:utf-8 -*-
import os
import time
from common import Common
comm = Common() cmd = r'adb logcat -v time -b main -b radio -b system >'
for i in range(3):
fn = r'../run_log/logcat' + str(i) + '.log'
os.popen(cmd+fn)
pid = comm.getAppPid('logcat')
while True:
fs = round(os.path.getsize(fn)/float(1024*1024),2)
time.sleep(1)
print ("当前文件的大小为:%s MB" %fs)
if fs >= 1:
kill_cmd = 'adb shell kill ' + pid
os.popen(kill_cmd)
break
print ("当前的日志文件为:%s" %fn)