Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

get debugger listening port from code

Discussion in 'Editor & General Support' started by KnightPista, Nov 12, 2019.

  1. KnightPista


    May 18, 2015
    Hi, when you start a development build, you can attach to it using Visual Studio->Attach Unity Debugger.
    There you can find running instances to which you can connect (with their port displayed).

    Is there a way I can get this port from the script code?

    It is useful, when you run multiple instances of development build on a single machine and you want to connect to the one specific instance. If you could detect that port number, you can display that port number on screen or in window title bar, so then you know on which instance to connect.

    Thank you.
    Last edited: Nov 12, 2019
    UbiAnthonyB likes this.
  2. UbiAnthonyB


    Jun 28, 2019
    Cant believe this isn't answered!