Search Unity

Profiler drops connection (with adb, unity 2019.3.5f1)

Discussion in 'Editor & General Support' started by unity_jdCuFNwBnyPb2g, Feb 3, 2021.

  1. unity_jdCuFNwBnyPb2g

    unity_jdCuFNwBnyPb2g

    Joined:
    Jan 15, 2019
    Posts:
    5
    Hi, I'm trying to profile my app by connecting via adb. I'm getting up to 7-8 frames in profiler window and then then nothing (dropdown switches to "Playmode", if i switch back to "AndroidPlayer" it switches back to "Playmode", no more frames appear unless I restart the device completely (not just the app)).

    I'm building with options:
    device has adb debugging enabled and shows up in adb fine.
    I am forwarding output as described in the manual.
    After selecting AndroidPlayer(@ADB127.0.0.1:34999) in Profiler window, I am sometimes able to see up to 8 frames in the profiler. After that, as described above, it switches to "Playmode". In adb, device now appears as offline:
    Forcing it to reset (by switching usb port mode to "host" and back to "device") makes it appear as "device" again, but doesn't produce any more frames in profiler window.

    I believe I was able to profile that same app with adb in Unity 2017.2.1f1, but I might misremember that.

    Anything I am missing?
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,456
    Hello,

    Could you please check if the log file on the device contains any information for why the connection might have dropped out? It could be that the Profiler ends up piling up too much info to send over, runs out of memory or looses the socket connection and fails to re-initialize the connection.

    Generally speaking, we are and have been fixing a set of underlying stability issues that might include this one (I don't yet have enough info to be certain that it isn't a bespoke one), and some of those have landed and some are in varying states of backports, so making sure you are on the latest patch release of your Unity version goes a long way to ensuring you are as close to these as you can be. In your case 2019.3.5f1 is a fair set of fixes away from the latest version on that release branch at (currently) 2019.4.19.f1.

    I can't promise it'll work there as I'm not 100% certain which connection issues have landed on 2019.x so far and which one you are hitting here. If you do update to 2019.4.19.f1 and still have this occurring, you can also file a bug report for this, just to make sure that your case is captured and that the fix will reach 2019.4.x once it is available.

    One fix that still hasn't landed for 2021.2 yet, and therefore has no backports kicked of yet, would stabilize the whole adb setup considerably. The issue tracker item for that specifically focuses on USB connection being disconnected but the fix goes beyond that. You can follow the progress of this item and vote for it here: Issue 1268987