# 性能分析器命令行参数

> Reference for arguments to start the with the command line.

设置性能分析器通过命令行启动的方式。

如果从命令行（例如 Windows 上的命令提示符，macOS 上的终端，Linux Shell，或者 Android 的 adb）启动构建的播放器或 Unity 编辑器，可以传递命令行参数来配置一些性能分析器设置。有关从命令行启动 Unity 的更多信息，请参阅[命令行参数](/engine/6000.0/manual/unity-editor/editor-features/command-line-arguments.md)。

| **命令行参数**                                        | **描述**                                                                                                                                                                                                                                        |
| ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-profiler-enable`                               | 对播放器或编辑器的启动进行性能分析。将此参数与播放器一起使用时，效果与启用[自动连接性能分析器 (Autoconnect Profiler)](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/build-settings-reference.md) 设置来构建播放器的效果相同。将此参数与编辑器一起使用时，在编辑器启动时会开始在性能分析器窗口中收集和显示性能分析器信息。 |
| `-profiler-log-file <Path/To/Log/File.raw>`      | 启动时将配置文件数据流式传输到 .raw 文件。此参数对播放器和编辑器均有效。                                                                                                                                                                                                       |
| `-profiler-capture-frame-count <NumberOfFrames>` | 用于设置启动后流式传输到 .raw 文件时要在性能分析中捕获的帧数量。此参数仅对播放器有效。                                                                                                                                                                                                |
| `-profiler-maxusedmemory`                        | 设置性能分析器在启动时使用的最大内存量（以字节为单位）（例如，`-profiler-maxusedmemory 16777216`）。`maxUsedMemory` 的默认值是 16MB（对于播放器）和 256MB（对于编辑器）。                                                                                                                           |
| `-connection-id`                                 | 设置从命令行启动播放器时设置的自定义播放器名称。还可以在[性能分析器偏好 (Profiler Preferences) 窗口](/engine/6000.0/manual/analysis/profiler/preferences-reference.md)中设置此名称。                                                                                                      |

## 其他资源##additional-resources

* [应用程序性能分析](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications.md)
* [性能分析器偏好参考](/engine/6000.0/manual/analysis/profiler/preferences-reference.md)
* [性能分析器构建配置文件设置参考](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/build-settings-reference.md)
