专项测试答疑帖

在下面说出你的问题

1 Like

1.使用dumpsys meminfo 获取数据偶尔会返回空(app一定在测试机上),是什么原因呢?

2.如果要获取app操作时的cpu、memory的数据,除了dumpsys meminfo/cpuinfo(由于这个取的是某段时间的平均值,我想要单次抓取的),还有什么其他更好的方式获取数据快照么?(top获取特慢,不太合适)

在 Mac 平台使用 systrace 正常;但是在 Win 下一直有报错:

These categories are unavailable: disk rs binder_driver
Starting tracing (stop with enter)
Tracing completed. Collecting output...
Exception in thread Thread-12:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 202, in _collect_and_preprocess
    trace_data = self._collect_trace_data()
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 277, in _collect_trace_data
    raise IOError('Unable to get atrace data. Did you forget adb root?')
IOError: Unable to get atrace data. Did you forget adb root?

Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\systrace.py", line 49, in <module>
    sys.exit(run_systrace.main())
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 204, in main
    main_impl(sys.argv)
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 201, in main_impl
    controller.OutputSystraceResults(write_json=options.write_json)
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\systrace_runner.py", line 68, in OutputSystraceResults
    self._out_filename)
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 99, in GenerateHTMLOutput
    html_file.write(_ConvertToHtmlString(result.raw_data))
  File "C:\Users\HBoPRC\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 121, in _ConvertToHtmlString
    raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output

使用的时管理员启动 cmd,也换过不同的文件夹启动;内外网都查了下,没找到时什么原因

关闭