Giter Site home page Giter Site logo

monkeytest's Introduction

monkey android test

  • python3
  • Statistical performance cpu,men,fps,battery,flow(wifi,gprs)
  • Statistics crash info.
  • muilt android

monkey.ini setting


cmd=monkey -p com.jianshu.haruki --throttle 500 --ignore-timeouts --ignore-crashes   --monitor-native-crashes -v -v -v 200 >
package_name=com.jianshu.haruki
activity = com.baiji.jianshu.account.SplashScreenActivity
net = wifi 
  • throttle Each event waits for 500 milliseconds
  • net gprs or wifi

monkey½á¹û

monkey½á¹û

monkey½á¹û

other

monkeytest's People

Contributors

louis-me avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monkeytest's Issues

get_fps 始终是60..

看了一下源码,没有弄清楚获取time_block的关键字段在哪里

    for frame in frames:
        time_block = re.split(r'\s+', frame.strip())
        if len(time_block) == 3:
            try:
                print time_block
                render_time = float(time_block[0]) + float(time_block[1]) + float(time_block[2])
                print render_time
            except Exception as e:
                render_time = 0
        if render_time > 16.67:
            print 'here'
            jank_count += 1
            if render_time % 16.67 == 0:
                vsync_overtime += int(render_time / 16.67) - 1
            else:
                vsync_overtime += int(render_time / 16.67)

第一个if 只会报出异常导致render_time = 0. 第二个if 也不会执行.. 最后直接就只能输出60...

不支持ubuntu linux平台吗?

我git clone下来源码工程 放入有相关包环境的 pycharm

右键执行monkeyTest.py Run窗口看错误解决了几个权限问题后,发现有个强制执行
def killport():
os.system(PATH('./kill5037.bat')) 这个win环境下的批处理。 该行无法在linux环境运行的吧。

所以一致会有如下的错误:

/usr/bin/python3.5 /home/cmd/workspace/git/monkeyTest/monkeyTest.py

/home/cmd/workspace/git/monkeyTest/kill5037.bat: 1: /home/cmd/workspace/git/monkeyTest/kill5037.bat: @echo: not found
Base Chinese.md MainActivity.java README.md img info kill5037.bat monkey.ini monkey1.apk monkeyTest.py report.xlsx liyu 2015-01-15***
Base Chinese.md MainActivity.java README.md img info kill5037.bat monkey.ini monkey1.apk monkeyTest.py report.xlsx v1.0.0 Base Chinese.md MainActivity.java README.md img info kill5037.bat monkey.ini monkey1.apk monkeyTest.py report.xlsx
/home/cmd/workspace/git/monkeyTest/kill5037.bat: 2: /home/cmd/workspace/git/monkeyTest/kill5037.bat: color: not found

/home/cmd/workspace/git/monkeyTest/kill5037.bat: 3: /home/cmd/workspace/git/monkeyTest/kill5037.bat: title: not found

Checking adb port...
/home/cmd/workspace/git/monkeyTest/kill5037.bat: 10: /home/cmd/workspace/git/monkeyTest/kill5037.bat: Syntax error: Bad for loop variable
adb devices
adb -s 45806625 shell wm size
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/home/cmd/workspace/git/monkeyTest/monkeyTest.py", line 88, in start
mkdirInit(devices, app, num)
File "/home/cmd/workspace/git/monkeyTest/monkeyTest.py", line 54, in mkdirInit
app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
File "/home/cmd/workspace/git/monkeyTest/monkeyTest.py", line 38, in get_phome
bg = BasePhoneMsg.get_phone_Kernel(devices)
File "/home/cmd/workspace/git/monkeyTest/Base/BasePhoneMsg.py", line 66, in get_phone_Kernel
pix = get_app_pix(devices)
File "/home/cmd/workspace/git/monkeyTest/Base/BasePhoneMsg.py", line 62, in get_app_pix
return subprocess.check_output(cmd).split()[2].decode()
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.5/subprocess.py", line 947, in init
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'adb -s 45806625 shell wm size'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/cmd/workspace/git/monkeyTest/monkeyTest.py", line 154, in
runnerPool()
File "/home/cmd/workspace/git/monkeyTest/monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "/usr/lib/python3.5/multiprocessing/pool.py", line 260, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.5/multiprocessing/pool.py", line 608, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'adb -s 45806625 shell wm size'

Process finished with exit code 1

请问 如果想在ubuntu调通 该如何弄

启动时失败

======================
*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
�ɹ�: ����ֹ PID Ϊ 18412 �Ľ��̡�
adb devices
cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: 由于目标计算机积极拒绝,无法连接。 (10061)
adb -s P7CDU17B22002323 shell wm size
adb -s P7CDU17B22002323 shell cat /proc/meminfo
adb -s P7CDU17B22002323 shell cat /system/build.prop
cat: /system/build.prop: Permission denied
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Program Files\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "D:\library\monkey\monkeyTest-master\monkeyTest.py", line 88, in start
mkdirInit(devices, app, num)
File "D:\library\monkey\monkeyTest-master\monkeyTest.py", line 54, in mkdirInit
app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
File "D:\library\monkey\monkeyTest-master\monkeyTest.py", line 38, in get_phome
bg = BasePhoneMsg.get_phone_Kernel(devices)
File "D:\library\monkey\monkeyTest-master\Base\BasePhoneMsg.py", line 68, in get_phone_Kernel
phone_msg = getModel(devices)
File "D:\library\monkey\monkeyTest-master\Base\BasePhoneMsg.py", line 35, in getModel
output = subprocess.check_output(cmd).decode()
File "C:\Program Files\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Program Files\Python36\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'adb -s P7CDU17B22002323 shell cat /system/build.prop' returned non-zero exit status 1.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:/library/monkey/monkeyTest-master/monkeyTest.py", line 153, in
runnerPool()
File "D:/library/monkey/monkeyTest-master/monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "C:\Program Files\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "C:\Program Files\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
subprocess.CalledProcessError: Command 'adb -s P7CDU17B22002323 shell cat /system/build.prop' returned non-zero exit status 1.

Process finished with exit code 1

请清理干净自家运行写死的路径啊...... 太坑了....

BaseMonitor.py
if name == 'main':

# cpu_rate("2749")
pid = get_pid("com.jianshu.haruki", "DU2TAN15AJ049163")
# print(pid)
# get_flow(pid, "wifi", "DU2TAN15AJ049163")
# get_battery("DU2TAN15AJ049163")
# get_men("com.jianshu.haruki", "DU2TAN15AJ049163")
# print(get_cpu_kel())
# cpu_kel = get_cpu_kel("DU2TAN15AJ049163")
# print(cpu_rate(pid,cpu_kel,"DU2TAN15AJ049163"))
get_flow(pid, "gprs", "emulator-5554")
# print(get_flow("com.jianshu.haruki", "gprs"))
# print(get_flow("com.jianshu.haruki", "gprs"))
# print(get_flow("com.jianshu.haruki", "gprs"))

BasePickle.py
if name == "main":
# readInfo(PATH("../info/DU2TAN15AJ049163_battery.pickle"))
# readInfo(PATH("../info/emulator-5554_fps.pickle"))
# readInfo(PATH("../info/emulator-5554_battery.pickle"))
# readInfo(PATH("../info/emulator-5554_men.pickle"))
# readInfo(PATH("../info/DU2TAN15AJ049163_men.pickle"))
# readInfo(PATH("../info/emulator-5554_flow.pickle"))
readInfo("E:\app\py\monkey1\info\info.pickle")
# readInfo(PATH("../info/DU2TAN15AJ049163_cpu.pickle"))

BaseReport.py
if name == 'main':

workbook = xlsxwriter.Workbook('report.xlsx')
info = [{'emulator-5554': {'cpu': 'E:\\app\\py\\monkey1\\info\\emulator-5554_cpu.pickle', 'battery': 'E:\\app\\py\\monkey1\\info\\emulator-5554_battery.pickle', 'men': 'E:\\app\\py\\monkey1\\info\\emulator-5554_men.pickle', 'flow': 'E:\\app\\py\\monkey1\\info\\emulator-5554_flow.pickle', 'header': {'rom': 770300, 'kel': '2核', 'monkey_log': 'E:\\app\\py\\monkey1\\log\\55dd9a83-3337-46d5-bb1f-6f64b85be7cbmonkey.log', 'beforeBattery': 99, 'pix': '1440x810', 'time': '10秒', 'afterBattery': 99, 'phone_name': 'GT-I9500_samsung_4.4', 'net': 'gprs'}, 'fps': 'E:\\app\\py\\monkey1\\info\\emulator-5554_fps.pickle'}}, {'DU2TAN15AJ049163': {'cpu': 'E:\\app\\py\\monkey1\\info\\DU2TAN15AJ049163_cpu.pickle', 'battery': 'E:\\app\\py\\monkey1\\info\\DU2TAN15AJ049163_battery.pickle', 'men': 'E:\\app\\py\\monkey1\\info\\DU2TAN15AJ049163_men.pickle', 'flow': 'E:\\app\\py\\monkey1\\info\\DU2TAN15AJ049163_flow.pickle', 'header': {'rom': 3085452, 'kel': '8核', 'monkey_log': 'E:\\app\\py\\monkey1\\log\\732ac6cd-dd84-4818-80ea-d9b5339c6774monkey.log', 'beforeBattery': 94, 'pix': '1080x1920', 'time': '15秒', 'afterBattery': 94, 'phone_name': 'H60-L02_Huawei_4.4', 'net': 'gprs'}, 'fps': 'E:\\app\\py\\monkey1\\info\\DU2TAN15AJ049163_fps.pickle'}}]


tem = OperateReport(workbook)
tem.monitor(info)
tem.analysis(info)
tem.crash()
tem.close()
# print(len(data["cpu"]))

这哪里叫开源啊.....

win10 环境 也整不起啊

ubuntu 不行 我又切到了win10系统

还是git clone 先
接下来逐一排坑:
1 先改了 monkey.ini
[DEFAULT]
cmd=monkey -p com.huasheng.stock --throttle 500 --ignore-timeouts --ignore-crashes --monitor-native-crashes -v -v -v 200 >
package_name=com.huasheng.stock
activity = com.huasheng.stock.ui.MainActivity
net = wifi

2 走你第一回
D:\workspace\git\monkeyTest>python3 monkeyTest.py

*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
成功: 已终止 PID 为 10896 的进程。

adb port has been released!

Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 66, in runnerPool
shutil.rmtree((PATH("./info/"))) # 删除持久化目录
File "D:\Python36\lib\shutil.py", line 494, in rmtree
return _rmtree_unsafe(path, onerror)
File "D:\Python36\lib\shutil.py", line 376, in _rmtree_unsafe
onerror(os.listdir, path, sys.exc_info())
File "D:\Python36\lib\shutil.py", line 374, in _rmtree_unsafe
names = os.listdir(path)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'D:\workspace\git\monkeyTest\info'

根据错误 在该目录下创建info目录.

3 走你第二回

D:\workspace\git\monkeyTest>python3 monkeyTest.py

*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
成功: 已终止 PID 为 10940 的进程。

adb port has been released!

adb devices

  • server not running *
    设备不存在

提示设备不存在,好吧,连接小米 并检查连接.

D:\workspace\git\monkeyTest>adb devices -l
List of devices attached
12345678 device product:chiron model:MIX_2 device:chiron

4 走你第三回
D:\workspace\git\monkeyTest>python3 monkeyTest.py

*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
成功: 已终止 PID 为 9800 的进程。

adb port has been released!

adb devices

  • server not running *
    adb -s 45806625 shell wm size
    adb -s 45806625 shell cat /proc/meminfo
    adb -s 45806625 shell cat /system/build.prop
    adb -s 45806625 shell cat /proc/cpuinfo
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    ------writeSum-------
    1
    adb -s 45806625 shell monkey -p com.huasheng.stock --throttle 500 --ignore-timeouts --ignore-crashes --monitor-native-crashes -v -v -v 200 >>D:\workspace\git\monkeyTe st\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log
    系统找不到指定的路径。
    系统找不到指定的路径。
    系统找不到指定的路径。
    ----get_pid-------
    adb -s 45806625 shell ps | findstr com.huasheng.stock
    adb -s 45806625 shell cat /proc/cpuinfo
    adb -s 45806625 shell dumpsys battery
    Current.Battery.Service.state:.AC.powered:.false.USB.powered:.true.Wireless.powered:.false.Max.charging.current:.0.Max.charging.voltage:.0.Charge.counter:.0.status:.2.h ealth:.2.present:.true.level:.100.scale:.100.voltage:.4341.temperature:.320.technology:.Li-poly
    读取文件错误
    ------read-------
    D:\workspace\git\monkeyTest\info\45806625_battery.pickle
    []
    ------writeInfo-------
    [100]
    multiprocessing.pool.RemoteTraceback:
    """
    Traceback (most recent call last):
    File "D:\Python36\lib\multiprocessing\pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
    File "D:\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
    File "D:\workspace\git\monkeyTest\monkeyTest.py", line 103, in start
    with open(mc["monkey_log"], encoding='utf-8') as monkeylog:
    FileNotFoundError: [Errno 2] No such file or directory: 'D:\workspace\git\monkeyTest\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log'
    """

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "D:\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'D:\workspace\git\monkeyTest\log\238be041-f0f3-4fb4-aee5-b11ccd098919monkey.log'

根据错误提示,在该目录下创建log目录

5 走你第四回
D:\workspace\git\monkeyTest>python3 monkeyTest.py

*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
成功: 已终止 PID 为 9296 的进程。
错误: 没有找到进程 "9296"。
成功: 已终止 PID 为 16240 的进程。

adb port has been released!

adb devices

  • server not running *
    adb -s 45806625 offline shell wm size
    multiprocessing.pool.RemoteTraceback:
    """
    Traceback (most recent call last):
    File "D:\Python36\lib\multiprocessing\pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
    File "D:\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
    return list(map(*args))
    File "D:\workspace\git\monkeyTest\monkeyTest.py", line 88, in start
    mkdirInit(devices, app, num)
    File "D:\workspace\git\monkeyTest\monkeyTest.py", line 54, in mkdirInit
    app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
    File "D:\workspace\git\monkeyTest\monkeyTest.py", line 38, in get_phome
    bg = BasePhoneMsg.get_phone_Kernel(devices)
    File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 66, in get_phone_Kernel
    pix = get_app_pix(devices)
    File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 62, in get_app_pix
    return subprocess.check_output(cmd).split()[2].decode()
    File "D:\Python36\lib\subprocess.py", line 336, in check_output
    **kwargs).stdout
    File "D:\Python36\lib\subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.
    """

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "D:\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
subprocess.CalledProcessError: Command 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.

到此该错误 我就无能为力了,应该调整 'adb -s 45806625 offline shell wm size' returned non-zero exit status 1.

该命令了 这个应该我也可以....

启动失败

adb devices
adb -s prmrozz97dcqzlee shell wm size
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/Users/denghui.he/PycharmProjects/monkeyTest/monkeyTest.py", line 87, in start
mkdirInit(devices, app, num)
File "/Users/denghui.he/PycharmProjects/monkeyTest/monkeyTest.py", line 53, in mkdirInit
app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
File "/Users/denghui.he/PycharmProjects/monkeyTest/monkeyTest.py", line 37, in get_phome
bg = BasePhoneMsg.get_phone_Kernel(devices)
File "/Users/denghui.he/PycharmProjects/monkeyTest/Base/BasePhoneMsg.py", line 66, in get_phone_Kernel
pix = get_app_pix(devices)
File "/Users/denghui.he/PycharmProjects/monkeyTest/Base/BasePhoneMsg.py", line 62, in get_app_pix
return subprocess.check_output(cmd).split()[2].decode()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 420, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 501, in run
with Popen(*popenargs, **kwargs) as process:
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'adb -s prmrozz97dcqzlee shell wm size'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Users/denghui.he/PycharmProjects/monkeyTest/monkeyTest.py", line 153, in
runnerPool()
File "/Users/denghui.he/PycharmProjects/monkeyTest/monkeyTest.py", line 76, in runnerPool
pool.map(start, devices_Pool)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
FileNotFoundError: [Errno 2] No such file or directory: 'adb -s prmrozz97dcqzlee shell wm size'

请教报错信息~

hi, 我这边运行时一直报错,信息如下:
Traceback (most recent call last):
File "monkeyTest.py", line 154, in
runnerPool()
File "monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 251, in map
return self.map_async(func, iterable, chunksize).get()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 567, in get
raise self._value
OSError: [Errno 2] No such file or directory

麻烦您知道我该如何解决吗,非常感谢~

虚拟器Genymotion 卡在此处

D:\workspace\git\monkeyTest>adb devices -l
List of devices attached
192.168.60.101:5555 device product:vbox86p model:Samsung_Galaxy_S7___7_1_0___API_25___1440x2560 device:vbox86p

D:\Python36\python3.exe D:/workspace/git/monkeyTest/monkeyTest.py

*** liyu 2015-01-15***
*** v1.0.0 ***


Checking adb port...
�ɹ�: ����ֹ PID Ϊ 11192 �Ľ��̡�
����: û���ҵ����� "11192"��
����: û���ҵ����� "11192"��
����: û���ҵ����� "18944"��
����: û���ҵ����� "14632"��

adb port has been released!

error: protocol fault (couldn't read status): Connection reset by peer
adb devices
adb -s * daemon not running. starting it now at tcp:5037 ** daemon started successfully *192.168.60.101:5555 shell wm size
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "D:\Python36\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "D:\Python36\lib\multiprocessing\pool.py", line 44, in mapstar
return list(map(*args))
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 88, in start
mkdirInit(devices, app, num)
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 54, in mkdirInit
app[devices] = {"cpu": cpu, "men": men, "flow": flow, "battery": battery, "fps": fps, "header": get_phome(devices)}
File "D:\workspace\git\monkeyTest\monkeyTest.py", line 38, in get_phome
bg = BasePhoneMsg.get_phone_Kernel(devices)
File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 66, in get_phone_Kernel
pix = get_app_pix(devices)
File "D:\workspace\git\monkeyTest\Base\BasePhoneMsg.py", line 62, in get_app_pix
return subprocess.check_output(cmd).split()[2].decode()
File "D:\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "D:\Python36\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'adb -s * daemon not running. starting it now at tcp:5037 ** daemon started successfully *192.168.60.101:5555 shell wm size' returned non-zero exit status 1.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:/workspace/git/monkeyTest/monkeyTest.py", line 154, in
runnerPool()
File "D:/workspace/git/monkeyTest/monkeyTest.py", line 77, in runnerPool
pool.map(start, devices_Pool)
File "D:\Python36\lib\multiprocessing\pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "D:\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
subprocess.CalledProcessError: Command 'adb -s * daemon not running. starting it now at tcp:5037 ** daemon started successfully *192.168.60.101:5555 shell wm size' returned non-zero exit status 1.

Process finished with exit code 1

多设备

hi,好像楼主没有做多设备处理。

执行过程中,头几行日志中 总会有"读取文件错误".

执行日志,头几行总是有 读取文件错误 且会影响到最终生成的report.xlsx 记录.


adb port has been released!

  • server not running *
    adb devices
    adb -s 45806625 shell wm size
    adb -s 45806625 shell cat /proc/meminfo
    adb -s 45806625 shell cat /system/build.prop
    adb -s 45806625 shell cat /proc/cpuinfo
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    创建文件成功
    ------writeSum-------
    1
    adb -s 45806625 shell monkey -p com.huasheng.stock --throttle 600 --ignore-timeouts --ignore-crashes --monitor-native-crashes -v -v -v 600 >>D:\workspace\git\monkeyTest\log\52c2b8ba-892a-4034-ac37-4b633e9f6c07monkey.log
    ----get_pid-------
    adb -s 45806625 shell ps | findstr com.huasheng.stock
    adb -s 45806625 shell cat /proc/cpuinfo
    adb -s 45806625 shell dumpsys battery
    Current.Battery.Service.state:.AC.powered:.false.USB.powered:.true.Wireless.powered:.false.Max.charging.current:.0.Max.charging.voltage:.0.Charge.counter:.0.status:.2.health:.2.present:.true.level:.96.scale:.100.voltage:.4322.temperature:.330.technology:.Li-poly
    读取文件错误
    ------read-------
    D:\workspace\git\monkeyTest\info\45806625_battery.pickle
    []
    ------writeInfo-------
    [96]
    adb -s 45806625 shell cat /proc/8539/stat
    utime=168
    stime=64
    cutime=1
    cstime=0
    processCpuTime=233
    adb -s 45806625 shell cat /proc/8539/stat
    utime=178
    stime=65
    cutime=1
    cstime=0
    processCpuTime=244
    adb -s 45806625 shell cat /proc/stat
    user=308300
    nice=30451
    system=198390
    idle=1759986
    iowait=5900
    irq=22627
    softirq=36061
    totalCpuTime2361715
    adb -s 45806625 shell cat /proc/stat
    user=308339
    nice=30465
    system=198422
    idle=1760775
    iowait=5902
    irq=22637
    softirq=36063
    totalCpuTime2362603
    totalCpuTime3=7104
    processCpuTime3=11
    读取文件错误
    ------read-------
    D:\workspace\git\monkeyTest\info\45806625_cpu.pickle
    []
    ------writeInfo-------
    [0.15484234234234234]
    --------cpu--------
    0.15484234234234234
    adb -s 45806625 shell dumpsys meminfo com.huasheng.stock
    Applications.Memory.Usage.(in.Kilobytes):.Uptime:.8764865.Realtime:.10567255..MEMINFO.in.pid.8539.[com.huasheng.stock]..Pss.Private.Private.SwapPss.Heap.Heap.Heap.Total.Dirty.Clean.Dirty.Size.Alloc.Free.------.------.------.------.------.------.------.Native.Heap.20059.19992.0.0.36864.25456.11407.Dalvik.Heap.29678.29492.0.0.43266.26882.16384.Dalvik.Other.3464.3460.0.0.Stack.68.68.0.0.Ashmem.2.0.0.0.Gfx.dev.15404.15404.0.0.Other.dev.12.0.12.0..so.mmap.1798.164.444.0..jar.mmap.16.8.8.0..apk.mmap.793.0.424.0..ttf.mmap.147.0.12.0..dex.mmap.310.24.156.0..oat.mmap.32894.11472.17292.0..art.mmap.2937.2624.44.0.Other.mmap.26.4.0.0.EGL.mtrack.27529.27529.0.0.GL.mtrack.4848.4848.0.0.Unknown.4366.4364.0.0.TOTAL.144351.119453.18392.0.80130.52338.27791.App.Summary.Pss(KB).------.Java.Heap:.32160.Native.Heap:.19992.Code:.30004.Stack:.68.Graphics:.47781.Private.Other:.7840.System:.6506.TOTAL:.144351.TOTAL.SWAP.PSS:.0.Objects.Views:.322.ViewRootImpl:.1.AppContexts:.5.Activities:.2.Assets:.10.AssetManagers:.2.Local.Binders:.24.Proxy.Binders:.26.Parcel.memory:.15.Parcel.count:.60.Death.Recipients:.2.OpenSSL.Sockets:.20.WebViews:.0.SQL.MEMORY_USED:.585.PAGECACHE_OVERFLOW:.392.MALLOC_SIZE:.62.DATABASES.pgsz.dbsz.Lookaside(b).cache.Dbname.4.324.94.100/31/13./data/user/0/com.huasheng.stock/databases/beacon_db.4.3744.12.0/15/1./data/user/0/com.huasheng.stock/databases/hua-sheng.Asset.Allocations.zip:/data/app/com.huasheng.stock-1/base.apk:/assets/fonts/DINPro-Black.otf:.87K.zip:/data/app/com.huasheng.stock-1/base.apk:/assets/fonts/DINPro-Bold.otf:.88K.zip:/data/app/com.huasheng.stock-1/base.apk:/assets/fonts/DINPro-Light.otf:.86K.zip:/data/app/com.huasheng.stock-1/base.apk:/assets/fonts/DINPro-Medium.otf:.87K.zip:/data/app/com.huasheng.stock-1/base.apk:/assets/fonts/DINPro-Regular.otf:.85K
    读取文件错误
    ------read-------
    D:\workspace\git\monkeyTest\info\45806625_men.pickle
    []
    ------writeInfo-------
    [144351]
    adb -s 45806625 shell dumpsys gfxinfo com.huasheng.stock
    读取文件错误
    ------read-------
    D:\workspace\git\monkeyTest\info\45806625_fps.pickle
    []
    ------writeInfo-------
    [60]
    -----fps------
    60
    adb -s 45806625 shell cat /proc/8539/net/dev
    ------flow---------
    11010034
    ---data-----
    上行流量=11010034
    下行流量=3294876
    读取文件错误

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.