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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

ADB profiling data do not show up in profiler window

Discussion in 'Editor & General Support' started by kaiyum, Nov 7, 2018.

  1. kaiyum

    kaiyum

    Joined:
    Nov 25, 2012
    Posts:
    686
    I followed this guide: https://docs.unity3d.com/540/Documentation/Manual/Profiler.html
    My unity version: Unity LTS 2017.4.9f1
    Platform: Android

    I did "build and run" according to the guide:
    upload_2018-11-7_18-29-3.png

    I plugged the phone via USB cable. The adb console shows this:
    upload_2018-11-7_18-30-27.png

    And the profiler window looks like this:
    upload_2018-11-7_18-31-58.png

    See, there is no data coming up! :(:(
    I tried this too:
    upload_2018-11-7_18-33-14.png

    Still no luck. I can profile via wifi but its horribly slow. So slow that I can not even play on mobile while I am profiling in PC; looked like I was rendering images one in every seconds or so. So I thought adb profiling can give it a good shot.
     
  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,140
    The Manual pages you linked to are for Unity 5.4 and have been updated for 2017.4 where the port changed to 34999.
    That doesn't explain why build & run doesn't work though. I'm assuming you're not disconnecting the phone, restarting the app or killing adb daemon?
    This could be a bug. You could try if it works with a different Unity version or device or file a bug report directly.
    As a workaround, you could also try build and install it manually, then go to cmd and enter

    Code (CSharp):
    1. ~$ adb forward tcp:34999 localabstract:Unity-com.portbliss.GAMENAME
    2. ~$ adb shell am start -n com.portbliss.GAMENAME/com.unity3d.player.UnityPlayerActivity -e 'unity'
    And then choosing that target through the drop down in the Profiler window.

    While it shouldn't make a difference, maybe also try the Auto Connect Profiler option. But really, this should be working and I don't have enough insight into debugging via adb. Wifi usually does it for me.
     
  3. kaiyum

    kaiyum

    Joined:
    Nov 25, 2012
    Posts:
    686
    Thanks @MartinTilo .
    adb forward tcp:34999 localabstract:Unity-com.portbliss.GAMENAME

    This worked for me. :)
    On WiFi, the framerate is horrible. On cable it works like a magic :)
     
    friuns3 and MartinTilo like this.
  4. roointan

    roointan

    Joined:
    Jan 8, 2018
    Posts:
    77
    I don't know what magic is this, but it solved the problem for me!
    Connecting a Nokia 2 Android device, to a mac
    Nokia 2 is connected to a different wifi, than mac
    but whatever that command is doing, it fixes it.
    I have the data in profiler now.
    (Funny, that in build settings, under run device, I could see my device. Also with adb devices.
    But profiler could not connect to it)