

To use the Profiler to manually connect to a platform running your application, configure the settings in the Attach to Player drop-down. Connecting to your Player in the Profiler window

This is useful to get Deep Profiling information on your application’s start up times, however, this adds a small amount of overhead to your build. If you additionally enable the Deep Profiling Support setting, Unity performs Deep Profiling when the built Player starts, which means that the Profiler profiles every part of your code, and not just code timings explicitly wrapped in ProfilerMarkers. When you start the Player, it attempts to connect to the Profiler in the Editor located at the baked IP address. When you enable the Autoconnect Profiler setting, the Unity Editor bakes its IP address into the built Player during the build process. Build Settings window with Profiling options enabled When you enable this setting, two settings related to the Profiler become available: Autoconnect Profiler and Deep Profiling Support. To set this up, go to Build Settings (menu: File > Build Settings) and select your application’s target platform. You can only profile your application as a Development Build.

You can also connect to a device via IP address. To profile your application on its target release platform, connect the target device to your network or directly to your computer via cable. Profile your application on a target platform

This is particularly useful if your application has only been designed to work in Play mode, such as for movie making. The Unity Editor might affect the performance of your application, because it uses the same resources as your application when it’s running in Play mode, so you can also profile the Editor separately to determine what resources it uses. Profiling in Play mode doesn’t give you an accurate reflection of what the performance of your application looks like on a real device, but it is a useful tool to quickly check to see if the changes you make improve your application’s performance, after initially profiling on the end platform. So, to quickly assess the performance of your application you can profile it directly in Play mode in the Editor. However, it can be time-consuming to build your application every time you would like to improve elements of its performance. This gives you accurate timings about what impacts the performance of your application. The best way to get accurate timings about your application is to profile it on the end platform you intend to publish it on.
