There might be times during development when you need to get information from the logs of the standalone player you’ve built, the target device, the Package Manager or the Editor. The log files are useful when you have experienced a problem, to find out exactly where the problem occurred.
On macOS, you can access the Player, Package Manager, and Editor logs through the standard Console.app utility.
On Windows, the Package Manager and Editor logs are placed in folders which are not shown in the Windows Explorer by default. See below for more information on where to find the logs.
To view the Package Manager log, navigate to the Unity log folder:
操作系统 | 日志文件 |
---|---|
macOS | ~/Library/Logs/Unity/upm.log |
Windows | C:\Users\username\AppData\Local\Unity\Editor\upm.log |
On macOS, you can also use the standard Console.app utility to find the log under the ~/Library/Logs/Unity
folder.
On Windows, you can find the Editor log file in the local application data folder <LOCALAPPDATA>\Unity\Editor\Editor.log
, where <LOCALAPPDATA> is defined by CSIDL_LOCAL_APPDATA.
To view the Editor log, select Open Editor Log in Unity’s Console window.
操作系统 | 日志文件 |
---|---|
macOS | ~/Library/Logs/Unity/Editor.log |
Windows | C:\Users\username\AppData\Local\Unity\Editor\Editor.log |
On macOS, you can also use the standard Console.app utility to find the log under the ~/Library/Logs/Unity
folder.
On Windows, you can find the Editor log file in the local application data folder <LOCALAPPDATA>\Unity\Editor\Editor.log
, where <LOCALAPPDATA> is defined by CSIDL_LOCAL_APPDATA.
操作系统 | 日志文件 |
---|---|
macOS | ~/Library/Logs/Unity/Player.log |
Windows | C:\Users\username\AppData\LocalLow\CompanyName\ProductName\Player.log |
Linux | ~/.config/unity3d/CompanyName/ProductName/Player.log |
On Windows and Linux standalones, you can change the location of the log file, or stop Unity from logging to it. For more information, see the Command line arguments documentation.
通过 GDB 控制台或 Organizer Console 访问 XCode 中的设备日志。当应用程序未通过 XCode 调试器运行时,后一种控制台对于获取崩溃日志非常有用。
See the documentation on Troubleshooting and Reporting crash bugs for information about debugging crashes and issues.
Use the logcat console to access your device log. To use it, launch the adb application in the Android SDK/platform-tools directory with the logcat parameter:
$ adb logcat
You can also use the Dalvik Debug Monitor Server (DDMS) to access the logcat console. To launch DDMS, start it either from Eclipse or from inside the Android SDK/tools. DDMS also provides a number of other debug-related tools.
设备 | 日志文件 |
---|---|
桌面端 | %USERPROFILE%\AppData\Local\Packages<productname>\TempState\UnityPlayer.log |
Windows Phone | You can retrieve your Windows Phone log with Windows Phone Power Tools. The Windows Phone IsoStoreSpy also provides a number of helpful debugging tools. |
For WebGL, Unity writes the log output to your browser’s JavaScript console.
On Windows Vista and Windows 7, make the AppData folder visible in Windows Explorer using Tools > Folder Options > View (tab). The Tools menu is hidden by default. Press the Alt key once to display it.
On Windows 10, make the AppData
folder visible in Windows Explorer using View > Show/hide and enabling the Hidden items option.
2019–04–17 Page amended with limited editorial review
在 2017.3 中停止了 Tizen 支持 NewIn20173