How to use my own profiler on Unity's standalones?

Hi,

I’m trying to use a .NET profiler (I tried JetBrains dotTrace and ANTS profiler) to profile a standalone made with Unity.

Basically, I build my project as a “PC, Linux & Mac Standalone” application, with “Development build” checked (or not, tried both) so it creates a .exe file… let’s say test.exe.
Then, I launch test.exe from the profiler. The standalone starts normally, but the profiler doesn’t detect it.

So I came to this question: how can I use a profiler such as JetBrains dotTrace to profile my game?

Did you work out how to do this?

It should be possible , unity has a blog entry about the topic

@fffMalzbier . Thx for tip. I tried xperf, it does give details about the unity process, but it it does not go down to the code level.

I have been googling and it looks like the only profiler that can be used to analyse code unity is the inbuilt profiler.

It is a shame, because I use ANTS at work and I like it better than the UNity profiler.

It’s possible that dotTrace would work if you’re building a Windows Store App, but I’ve not tried it. The rest of the time the apps you build aren’t using the Microsoft .NET Framework, and therefore dotTrace won’t work with them.

1 Like

Necroing, as this was one of the only results when I googled this.

Profiling works fine in dotTrace, build with mono as your scripting backend, check “Script Debugging” etc then launch with dotTrace unity profiling mode: https://blog.jetbrains.com/dotnet/2019/04/03/profiling-mono-mono-unity-apps-windows-macos-linux/