I wanna profile webgl app on iphone which has crash issue because of out of memory.
I built webgl app on Mac and it can connect to Unity Profiler from local chrome.
From iPhone safari, can’t.
It shows
[Warning] [blocked] The page at https://192.168.0.17:5500/_webgl/ was not allowed to run insecure content from ws://127.51.68.120:54998/. (_WebGL.framework.js, line 6924)
From remote chrome on windows, it can’t also.
It shows error
WebSocket connection to ‘ws://127.51.68.120:54998/’ failed:
Mac ver: Ventura 13.6.1
Unity ver: 2022.3.9f1 silicon
iPhone ver:15 Pro Max
Security measures disallow connecting to a WebGL Player, so directly attaching is only possible with Autoconnect Profiler and Build & Run but I think you should be able to Profile to a file with Profiler.logFile + Profiler.enableBinaryLog or for Memory Profiling, MemoryProfiler.TakeSnapshot()
Got it. I’ll try the functions in your second suggestion.
Though, still I wanna know why Autoconnect Profiler doesn’t work from remote machine.
In the same machines it works, but from remote machine, it tries to connect with ‘ws://127.51.68.120:54998/’ (I think it trial of autoconnect profiler, isn’t it?), so it doesn’t work.
If that IP is determined by the AutoConnect profiler logic, there is a way to configure it?
It’s a general restriction of WebGL as a platform, the connection has to be established from the Player to the Editor, which means the Editor IP and process ID needs to be build into the Player (which Auto Connect does) and I’m not sure if then even needs to be established directly at the start (Which Build & Run does).
Would be worth investigating how to pass-along those two variables dynamically in -any- debug build. There’s obviously a hook to create a custom UI for the console logs… why not have an input field to copy/paste the values and relaunch the application (if it has to be done at init)?
The issue with Build & Run is that its rarely used in any serious WebGL application as those are deeply integrated with other Web Services. And those complex WebGL applications are what require the most profiling…
i noticed this issue on one computer that had multiple network connectors, it picked up the wrong IP (webgl browser console printed out that wrong ip), and was avoid by first disabling those additional connections on that pc…
Agreed. We had some requests into that direction before. You can help us prioritize that by adding your voice to our feedback database here via the Submit New Idea element.
Also, you can set the values in the boot.config file of the build but yeah, that’s not pretty in terms of UX.
For webgl build, I can’t find boot.config file in the outputs of build.
Under Library folder, I could find multiple boot.config files but I’m not sure whether editing those is correct&stable way and which file I should edit.
Under build output folder, I checked frameworks.js and loader.js and index.html, but I couldn’t find ip related code for AutoConnect profiler.