Hi guys, I want to do a graphic analysis of my game following the guidelines found here Unity - Manual: Xcode frame debugger Unity integration. However, it really confused me when it said “To load the Xcode frame debugger, launch the Unity Editor through Xcode, with Metal selected as the GPU Frame Capture option.”
So my question is how should we launch the Unity Editor through Xcode?
You can use the Xcode frame debugger to capture a frame of a complex scene
in your application, then identify bottlenecks in your shaders
. On devices with the A11 chip or later (iPhone 8 and newer devices), Xcode offers an even more detailed breakdown of shader timing. This allows you to analyze performance and debug vertex and fragment issues.
Please read the thread that you’re replying to. No one is asking what the frame debugger is nor why it is used. What are the steps to hook it up with the Unity Editor?
Ok, I got close, maybe this will help some people.
To launch Unity editor from Xcode:
Open Xcode
Select “Create a new Xcode project”
Under “Choose a template for your new project” select macOS → Command Line Tool and press Next button.
Enter a Product Name (i.e. MacEditor) and any additional information. I selected C++ for language. Press Next, and save to a location on your computer.
Now that you’re in your new project, select main.cpp and write a short script to open your specific project with Unity.
Here is an example, you can follow the general format using your specific Unity version and specific project path and name:
But when I press the button to capture a frame, it does not open the Xcode frame debugger. Nothing happens.
To be fair, at this point I haven’t fully followed the instructions at the link at the beginning of this thread. I still need to change the scheme of the MacEditor target to select Metal as the GPU Frame Capture option (it defaults to Automatically Enabled). But when I do that and press play, Unity launches, but now the little person icons are no longer there so I can’t even try to capture a frame. Wondering if that’s a bug. I do have Metal Editor Support checked in Project Settings.
So I got close. If anyone wants to try out what I’ve got so far and see if they can get further, please keep us posted! I’ll follow up if I have more luck.
I felt hopeful this would work since I did get the xcode Frame Debugger icon after following the above instructions. However clicking the icon did nothing at all. :(. Xcode shows that Unity is running, so I know it’s “connected” in some way. Icon appears in Unity… just doesn’t do anything.