Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

get debugger listening port from code

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

  1. KnightPista

    KnightPista

    Joined:
    May 18, 2015
    Posts:
    40
    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

    UbiAnthonyB

    Joined:
    Jun 28, 2019
    Posts:
    4
    Cant believe this isn't answered!