问题描述
如何运行 systrace
以显示其 html 输出?观看 Google I/O 2012 演讲后 "For Butter or Worse" 我无法使用运行 Jelly Bean 4.1 的模拟器让 systrace
在 Windows 7 上工作.
How can I run systrace
to show its html output? After watching the Google I/O 2012 talk "For Butter or Worse" I am having trouble getting systrace
to work on Windows 7 using the emulator running Jelly Bean 4.1.
我做了以下事情:
- 安装 Python 2.7,并将安装文件夹添加到我的 PATH
- 运行以下命令:
C:android-sdkplatform-toolssystrace>python systrace.py
(使用较旧的 SDK:C:android-sdkoolssystrace>python systrace.py
)
- Installed Python 2.7, and added the install folder to my PATH
- Ran the following:
C:android-sdkplatform-toolssystrace>python systrace.py
(with older SDKs:C:android-sdkoolssystrace>python systrace.py
)
但我在 cmd 中收到以下错误:
But I get the following error in cmd:
Traceback (most recent call last):
File "systrace.py", line 212, in <module>
main()
File "systrace.py", line 124, in main
ready = select.select([adb.stdout, adb.stderr], [], [adb.stdout, adb.stderr])
select.error: (10093, 'Either the application has not called WSAStartup, or WSAStartup failed')
注意:
- 我在模拟器中启用了跟踪:
Settings >开发者选项 >启用跟踪
- 我也尝试过使用 Python 3.2
推荐答案
systrace python 脚本使用 select() 系统调用,这在 Windows 上不起作用.Android SDK 工具的 最新预览版 (ADT21 rc9) 支持从监控工具.
The systrace python script uses the select() system call, and that doesn't work on Windows.The latest preview (ADT21 rc9) of the Android SDK tools include support for collecting system trace from within the monitor tool.
启动监视器为:
./tools/monitor &
点击一个设备,在设备面板的右上角,你应该有一个工具栏项,可以让你收集系统跟踪.
Click on a device, and at the top right of the device panel, you should have an toolbar itemn that allows you to collect system trace.
这篇关于在 Windows 7 上使用 Jelly Bean 4.1 模拟器在 ADB 中运行 systrace 工具时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!