resharper-unity icon indicating copy to clipboard operation
resharper-unity copied to clipboard

Rider cannot find running Unity process on an Android device

Open tallior opened this issue 3 years ago • 7 comments

I am actually not sure this is a problem with Rider, or is a general problem with how the Unity debugging layer works, but giving it a try here as well.

I've reported my problem on the Unity forums: https://forum.unity.com/threads/rider-debugger-cannot-see-app-on-mobile-device-android.1120324/#post-7205002

I would like to debug a Unity app running on my Android phone.

From reading the docs, i understand that debugging happens over TCP connection (read this page).

  • The test app i built was created in development mode, with script debugging enabled.
  • Running the same scenario at my home works fine (Rider lists the app running on the phone and can attach to it)
  • Running the scenario again at the office doesn't work.

The Unity profiler can attach to the app running on my phone (doesn't find it automatically - but works after i manually enter the IP address) From what i gathered so far, The Unity debugger works using broadcasts - the game broadcasts the port (and other info?) over the network, and Rider (or any other IDE) get those broadcasts and are then able to list the app and attach to it.

I suspect that this broadcast doesn't work while being in the office, but since the profiler "scans" for the correct port - it is able to connect anyway, even without the broadcast / "discovery" happening.

tallior avatar Jun 04 '21 05:06 tallior

One more thing to check. If Debugging is enabled, then Player.log should contain a line like: Starting managed debugger on port 56976 You may use it to connect the debugger manually.

van800 avatar Jun 04 '21 08:06 van800

Last time UDP broadcast started to work for me after disabling vmware network interfaces https://twitter.com/IvanShakhov/status/1392777047244787714

van800 avatar Jun 04 '21 08:06 van800

Last time UDP broadcast started to work for me after disabling vmware network interfaces https://twitter.com/IvanShakhov/status/1392777047244787714

i can try that, but the exact same setup (laptop + apk) work for me at home, while in the office - it doesn't. I tried connecting manually, but Rider gives an error message (something like DWP handshake failed)

tallior avatar Jun 04 '21 08:06 tallior

Have you tried temporary disabling network filter or any other firewall? Try this guide https://github.com/JetBrains/resharper-unity/wiki/Troubleshooting-debugging-Unity-players

van800 avatar Jun 04 '21 09:06 van800

i looked at the troubleshooting guide (together with the IT guys from my company). We were unable to fix the issue. Also, with the same conditions (Same laptop, same APK), just a different WIFI (at home) it works just fine.

Any other words of wisdom might help.

On Fri, Jun 4, 2021 at 12:36 PM Ivan Shakhov @.***> wrote:

Have you tried temporary disabling network filter or any other firewall? Try this guide https://github.com/JetBrains/resharper-unity/wiki/Troubleshooting-debugging-Unity-players

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JetBrains/resharper-unity/issues/2102#issuecomment-854533706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3RFPRAIPZREZPSVCBSQ2LTRCNA5ANCNFSM46CCVOKQ .

tallior avatar Jul 13 '21 18:07 tallior

Do you see Starting managed debugger on port 56976 in the Player.log?

van800 avatar Jul 14 '21 08:07 van800

@van800 yeh i see this in the adb logcat output: D/Unity (24167): Starting managed debugger on port 56547 Every time it's a different port.

tallior avatar Jul 14 '21 11:07 tallior

Closing this due to inactivity. Please feel free to leave a comment and we can reopen

citizenmatt avatar Jan 27 '23 00:01 citizenmatt