SUMMARY
I am looking for a straightforward way to get the port number that the Unity editor is using to serve WebGL test builds after the build's browser window has been closed.
I'm supporting Unity students who are not computer savvy. I'd like to know if there's an easy way to get this information from the editor itself, short of rebuilding the project.
DETAILS
To test my Unity WebGL project from the Unity Editor, I select the menu "File > Build and Run."
Once the project is built, a Chrome window opens with a location of the form "http://localhost:53587/", where 53587 is a random port number.
WHAT I HAVE TRIED
Google searches haven't given me an easy way to discover this port.
Using Window's Resource Monitor, I can find all the ports unity test servers are listening on, but this method requires many steps and external tools. I'd like know if there is a way within Unity to discover this information.
Complicated Method
- Press Ctrl+R to open the Run window.
- Type
resmon.exe
and press ENTER - Select the
Network
tab - Select the
Listening Ports
bar - Sort on image by clicking on the
image
column header - Search for image
mono.exe
- Get port number(s) from
Port
column.
This is relatively complicated, Windows-specific method and it's inexact; it can return multiple instances of test builds being served. I'd like an easy way of discovering the port being served for the project currently being edited.