開発の際に、ビルドしたスタンドアロンプレイヤー、ターゲットデバイス、Package Manager、エディターなどのログから情報を取得したい場合があります。ログファイルは、何か問題が発生したときに、実際にどこで問題が発生したかを明確にするために役立ちます。
All messages, warnings, and errors written to the Console window in the Editor is also written to these log files. You can write your own messages to the Console and log files using the Debug class.
macOS では、Console.app ユーティリティを使って、プレイヤー、Package Manager、エディターのログにアクセスできます。
Windows では、Package Manager とエディターのログは、デフォルトでは Windows エクスプローラーに表示されないフォルダーに置かれます。ログがどこにあるかについては、以下を参照してください。
Package Manager のログを表示するには、Unity のログフォルダーに移動します。
オペレーティングシステム | ログファイル |
---|---|
Linux | ~/.config/unity3d/upm.log |
macOS | ~/Library/Logs/Unity/upm.log |
Windows | C:\Users\username\AppData\Local\Unity\Editor\upm.log |
On macOS, you can also use the 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 CSIDL_LOCAL_APPDATA defines <LOCALAPPDATA>
.
To view the Editor log, open a Console Window (menu: Window > General > Console) and select Open Editor Log from the Console window menu.
オペレーティングシステム | ログファイル |
---|---|
Linux | ~/.config/unity3d/Editor.log |
macOS | ~/Library/Logs/Unity/Editor.log |
Windows | C:\Users\username\AppData\Local\Unity\Editor\Editor.log |
On macOS, you can also use the 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 CSIDL_LOCAL_APPDATA defines <LOCALAPPDATA>.
オペレーティングシステム | ログファイル |
---|---|
Linux | ~/.config/unity3d/CompanyName/ProductName/Player.log |
macOS | ~/Library/Logs/Company Name/Product Name/Player.log |
Windows | C:\Users\username\AppData\LocalLow\CompanyName\ProductName\Player.log |
Windows や Linux のスタンドアロンでは、ログファイルの場所を変更したり、ログを記録するのを止めたりすることができます。詳しくは、コマンドライン引数 のドキュメントを参照してください。
Xcode のデバイスログは GDB コンソール、または Organizer コンソールを通してアクセスできます。後者は Xcode デバッガーを通してアプリケーションを実行できなかった場合にクラッシュログを取得するのに便利です。
クラッシュや問題のデバッグについては、トラブルシューティング と クラッシュバグのレポート のドキュメントを参照してください。
デバイスのログにアクセスするには、logcat コンソール を使用します。これを使用するには、Android SDK/platform-tools ディレクトリの adb
アプリケーションを、 logcat
パラメーターを付けて起動します。
$ adb logcat
また、Android からログを取得するための UI インターフェースを提供する Package Manager を使って、Android Logcat パッケージを取得することもできます。
Device | ログファイル |
---|---|
デスクトップ | %USERPROFILE%\AppData\Local\Packages<productname>\TempState\UnityPlayer.log |
Windows Phone | Windows Phone Power Tools で、Windows Phone のログを取得することができます。Windows Phone IsoStoreSpy は、便利なデバッグツールも多数用意されています。 |
WebGL の場合、Unity はログ出力をブラウザーの JavaScript コンソール に書き込みます。
Windows Vista と Windows 7 では、Windows エクスプローラーの ツール > フォルダーオプション… > 表示 (タブ) で AppData フォルダーを表示できます。ツールメニューはデフォルトでは表示されていませんが、Alt キーを押すと表示されます。
Windows 10 の場合、AppData フォルダーを Windows エクスプローラーで表示するには、表示 > 表示/非表示 を選択し、隠しファイル オプションを有効にします。
Windows では、デフォルトでは標準の出力のストリームは存在しません。そのため、CI システムの子プロセスのように、有効に設定された stdout
ストリームを使ってエディターを起動する必要があります。-
を指定して stdout
に出力を送信する場合、コンソールウィンドウには出力が表示されません。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.