抓取 systrace 文件
adb shell "atrace gfx input view wm am res rs sched freq idle dalvik -b 20480 -t 10" > D:\test\test1.html
python C:\IDE\android_sdk\platform-tools\systrace\systrace.py --from-file=D:\test\test1.html
C:\Users\wwang>python C:\IDE\android_sdk\platform-tools\systrace\systrace.py --from-file=D:\test\test1.html
Traceback (most recent call last):
File "C:\IDE\android_sdk\platform-tools\systrace\systrace.py", line 48, in <module>
from systrace import run_systrace
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 41, in <module>
from devil import devil_env
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\devil_env.py", line 33, in <module>
import dependency_manager # pylint: disable=import-error
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\__init__.py", line 29, in <module>
from .archive_info import ArchiveInfo
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\archive_info.py", line 9, in <module>
from dependency_manager import exceptions
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\exceptions.py", line 5, in <module>
from py_utils import cloud_storage
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\common\py_utils\py_utils\cloud_storage.py", line 22, in <module>
from py_utils import lock
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\common\py_utils\py_utils\lock.py", line 21, in <module>
import win32file
ImportError: DLL load failed: 找不到指定的模块。
C:\Users\wwang>python -m pip install pypiwin32
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting pypiwin32
Downloading pypiwin32-223.tar.gz (622 bytes)
Collecting pywin32>=223
Downloading pywin32-228-cp27-cp27m-win_amd64.whl (7.5 MB)
|████████████████████████████████| 7.5 MB 1.1 MB/s
Using legacy 'setup.py install' for pypiwin32, since package 'wheel' is not installed.
Installing collected packages: pywin32, pypiwin32
Attempting uninstall: pywin32
Found existing installation: pywin32 218
ERROR: Cannot uninstall 'pywin32'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
解决办法:
把python安装包下的 C:\Python27\Lib\site-packages 下面的pywin32-218-py2.7.egg-info 去掉
这样重新再执行 python -m pip install pypiwin32 就没有问题了
又报了另一个问题:
C:\Users\wwang>python C:\IDE\android_sdk\platform-tools\systrace\systrace.py --from-file=D:\test\test1.html
Traceback (most recent call last):
File "C:\IDE\android_sdk\platform-tools\systrace\systrace.py", line 48, in <module>
from systrace import run_systrace
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 41, in <module>
from devil import devil_env
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\systrace\systrace\..\..\devil\devil\devil_env.py", line 33, in <module>
import dependency_manager # pylint: disable=import-error
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\__init__.py", line 29, in <module>
from .archive_info import ArchiveInfo
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\archive_info.py", line 10, in <module>
from dependency_manager import dependency_manager_util
File "C:\IDE\android_sdk\platform-tools\systrace\catapult\dependency_manager\dependency_manager\dependency_manager_util.py", line 12, in <module>
import six
ImportError: No module named six
解决方法:
python -m pip install six