Android·性能分析systrace报错

Android·性能分析systrace报错

1.systrace的使用

在window10系统下的操作
通过Android studio 底下 Terminal 进入到 /sdk/platform-tools/systrace/ 目录下
然后 Terminal 里面输入如下命令 systrace.py [options] [categories]
options 用 -o mytrace.html -t 10
categories 用 sched freq idle am wm gfx view binder_driver hal dalvik camera input res

即输入:systrace.py -o mytrace.html -t 10 sched freq idle am wm gfx view binder_driver hal dalvik camera input res

然后报如下的错:

Traceback (most recent call last):
  File "E:\sdk\platform-tools\systrace\systrace.py", line 48, in 
    from systrace import run_systrace
  File "E:\sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 40, in 
    from devil import devil_env
  File "E:\sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\devil_env.py", line 32, in 
    import dependency_manager  # pylint: disable=import-error
  File "E:\sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\__init__.py", line 29, in 
    from .archive_info import ArchiveInfo
  File "E:\sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\archive_info.py", line 9, in 
    from dependency_manager import exceptions
  File "E:\sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\exceptions.py", line 5, in 
    from py_utils import cloud_storage
  File "E:\sdk\platform-tools\systrace\catapult\common\py_utils\py_utils\cloud_storage.py", line 21, in 
    from py_utils import lock
  File "E:\sdk\platform-tools\systrace\catapult\common\py_utils\py_utils\lock.py", line 18, in 
    import win32con    # pylint: disable=import-error
ImportError: No module named win32con

这时说明只安装了python2.7, 我用的Android studio3.4版本因此必须安装python2.7。
报这个错说明还需要安装pywin32.
python2.7与pywin32软件路径:
https://www.python.org/downloads/release/python-270/
https://github.com/mhammond/pywin32/releases
打包好的在csdn,地址如下:
https://download.csdn.net/download/jfj12345678/11244570
安装完就可以继续操作了。
剩下的网上挺多的就不叙述了,如果没找到的推荐两篇。

https://www.jianshu.com/p/19b3245207e8
https://www.cnblogs.com/1996swg/archive/2018/11/23/10007602.html

你可能感兴趣的:(android,java,android,systrace,java)