The Xcode frame debugger tool lets you capture a frame of your application to see the commands that the GPU performed during that frame, examine data in GPU memory, and identify bottlenecks in your shaders. This lets you analyze GPU performance in fine detail.
Unity は、Xcode のフレームデバッガーと以下のように統合されています。
Frame debugging only works if the application is running on a platform and graphics API that Xcode supports. Xcode only supports macOS with Metal graphics. If Unity uses another API, the Xcode integration is disabled until you select a supported graphics API.
Xcode のフレームデバッガーを使ってフレームをキャプチャするには、以下のいずれかを行います。
このセクションでは、Xcode UI または FrameCapture API を使用してアプリケーションを起動し、フレームキャプチャを実行する方法について説明します。このワークフローは、Metal を使用するすべてのプラットフォームに適用できます。
1. Xcode のプロジェクトを作成します。
Unity エディターから Xcode プロジェクトを作成するか、他の Xcode プロジェクトを使用して macOS アプリケーションを起動することができます。
Unity エディターから Xcode プロジェクトをビルドする場合、以下を行います。
別の Xcode プロジェクトを使用して macOS アプリケーションを起動するには、以下を行います。
2. Xcode プロジェクトのスキームを編集して、フレームキャプチャを実行できるようにします。
Xcode GUI を使用します。これを行うには、Xcode ドキュメントの Enabling Frame Capture ガイド に従い、プロジェクトスキームの GPU Frame Capture 設定を Metal に設定します。
3. Xcode からプロジェクトを起動し、フレームキャプチャを実行します。
また、FrameCapture API を使用して、スクリプトからフレームキャプチャを実行することができます。Xcode でのフレームキャプチャデータの分析については、Xcode フレームデバッガーのドキュメント を参照してください。
このセクションでは、コマンドラインからアプリケーションを起動し、FrameCapture API を使用してフレームキャプチャを実行し、その結果をディスクに保存する方法を説明します。 重要: このワークフローは、iOS ではサポートされていません。iOS 上でフレームキャプチャを実行するには、常に Xcode からアプリケーションを起動する必要があります。
-enable-metal-capture
を設定します。Xcode は、コードが要求するとフレームキャプチャを実行し、その結果をディスクに保存します。Xcode でこのデータを分析する方法については、Apple の Xcode フレームデバッガーに関するドキュメント を参照してください。
macOS では、Xcode のフレームデバッガーを使って、Unity エディターからフレームを解析することができます。Xcodeを使用してUnity エディターを起動した場合、Unity エディターの UI からフレームキャプチャを要求することができます。
This section describes how to launch the Unity Editor from Xcode and perform a frame capture using the Unity Editor UI, the Xcode UI, or the FrameCapture API. You can analyze the frame capture immediately, or save the results to disk. This workflow is supported on macOS.
FrameCapture
API. For more information, see the FrameCapture API documentation.For information on analyzing frame capture data in Xcode, see Apple’s Xcode frame debugger documentation.
このワークフローは、コマンドラインから Unity エディター を起動し、FrameCapture API を使用してフレームキャプチャを実行し、フレームキャプチャをディスクに保存する方法について説明します。このワークフローは、macOS でサポートされています。
-enable-metal-capture
を設定します。Xcode は、コードが要求するとフレームキャプチャを実行し、その結果をディスクに保存します。Xcode でこのデータを解析する方法については、Xcode fフレームデバッガーに関するドキュメント を参照してください。
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.