Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android Device Can't Able To Connect With Profiler Window

Discussion in 'Editor & General Support' started by siddharth3322, Apr 17, 2019.

  1. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I want to get performance analytics of my game using Profiler so I have exported build with Autoconnect Profile setting enabled.

    After this process build installed within an Android device but it can't able to run the game, it just displaying black screen nothing else. Profiler can't able to connect with connect device, I was getting this kind of list:

    drifter_profiler_connect.PNG

    Now android device showing just black screen and profiler not moving ahead, it just remains connected with Editor only.

    I have tried to connect and disconnect my Android device multiple time but nothing changed in this. Please give me some suggestion into this so I can start my debugging process.

    I have already gone through this post:
    https://docs.unity3d.com/Manual/ProfilerWindow.html

    After 2 Days:
    Still my Autoconnect Profiler build not working in Android build without that its working fine - what is the solution for me?
    Android device just showing black screen - no unity logo splash screen nothing else happening.
    After spending few minutes, I require to press Home button of device to close the game.
     
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Hi @siddharth3322 !

    Is it possible for you to connect when using direct IP? Could you please check see what is the phone's IP and enter it into <Enter IP> menu item.
    Sometimes Autoconnect Profiler might embed wrong IP into player. Could you please check if boot.config file inside the APK contains correct IP of the machine where the Editor is running. The problem might arise if boot.config does not contain Editor IP from the same subnet where device is running.
     
  3. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    I have connected my Android phone with my office Wi-Fi connection and installed Autoconnect profiler build again my phone. Withing profiler window, I have manually set IP address of my device.
    But I can't able to get connected and I was getting this kind of messages:
    profiler_connecting_timeout.PNG

    At above, you have mentioned boot.config file, where can I found this?
    and at their shall I require to update IP address?
     
  4. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Make sure there is no firewall blocking the connection. That is a usual issue when connecting trough WiFi.

    If you can't connect with the Editor there is another way to get profiler data - use https://docs.unity3d.com/ScriptReference/Profiling.Profiler-enabled.html runtime API to dump profiler data to disk. Then you need to copy it from the device and open in profiler.
     
    Ali_V_Quest likes this.
  5. siddharth3322

    siddharth3322

    Joined:
    Nov 29, 2013
    Posts:
    1,049
    Today also same problem started.
    My Autoconnect Profiler build is not working with the Android platform.
    If I take out build without Autoconnect Profiler then its working fine.

    In the Android device, I was just getting black screen nothing else and nothing happening with Profiler window in the Unity editor.
    Then what the solution for me into this?
    Because I am struggling with game performance and I can't able to see the Profiler data.
     
  6. faizan1990

    faizan1990

    Joined:
    Sep 30, 2019
    Posts:
    8
    Did you manage to find a solution to this problem?
     
  7. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    I've noticed for as long as I've used Unity that if I build and run from the editor, then the first time the app runs I can connect the profiler. But any consecutive runs (Or even the first run if I install the app via command line (adb install ... )) the profiler can't 'see' the application.The drop down list does not contain the device. I can connect to it over WiFi, but I want to connect directly via USB. The option has just never worked for me.
     
    jemca, eli_123 and alexeyzakharov like this.
  8. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Could you please file a bug - it might be related the virtual connection we create for adb proxy not being reset properly
     
    Prodigga likes this.
  9. yaniv_unity392

    yaniv_unity392

    Joined:
    Oct 7, 2018
    Posts:
    12
    Hey, any update on the matter?
     
  10. HeadupMark

    HeadupMark

    Joined:
    Mar 19, 2020
    Posts:
    1
    Same issue here. Trying to connect to different devices via USB all day long. Even though devices are listed correctly via "adb devices" and I can install stuff via adb, the profiler simply does not want to connect. It once did for a couple of seconds but after restarting and changing devices it simply does nothing at all.. Anyone any good solution for this?
     
  11. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,432
    Please keep filing bug reports for this. Even if this leads to duplicated reports. We need to know in as much detail as possible what is still broken on the connection side, e.g. which devices, Unity versions etc. We're working hard on fixing all these connection issues and everywhere but we'd be very glad for your contribution to solving these once and for all.

    Just please make sure to try these on the latest patch release of whichever Unity version you're on in case we already did.
     
  12. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
    Still doesn't work.
    Editor: Unity 2019.4.9f1 (Windows)
    Device: Google Pixel XL (Android 10)

    Try to dig into TCP over USB for wire connected devices.
    And Multicast for wireless connected devices.
     
  13. Pixionrevolution

    Pixionrevolution

    Joined:
    Feb 2, 2017
    Posts:
    5
    It finally worked for me when I connected the profiler through IP adress AFTER launching the app on the device. It seems to work for me like this even though the app also crashed from time to time. Hope it could help some!
     
  14. _dongzi

    _dongzi

    Joined:
    May 26, 2013
    Posts:
    2
    Is this problem Solved?What should I do?
     
  15. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    I had to disable AutoConnect profiler for it to work
     
  16. salvolannister

    salvolannister

    Joined:
    Jan 3, 2019
    Posts:
    50
    I succeeded in profiling adding the IP, found under "Settings->About Phone->Status", manually
     
  17. vsokolenko

    vsokolenko

    Joined:
    May 5, 2020
    Posts:
    1
    Still have this issue in Unity 2020.3.14f1. The Autoconnect Profiler option sometimes causes game freeze on the black screen during the game startup on Android. Also, the Unity profiler doesn't work when this option is enabled (both via USB and WiFi).
    Disabling the option fixes freezes and the profiler.
     
  18. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    Same problem here on lastest 2020 lts
    im having a way worse performance on that unity version for my oculus quest game, and im not able to compare profiler because i can not even get profiling info
     
  19. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    343
    By build and play i was able to profile as long as i dont disconect the usb
     
    Prodigga likes this.
  20. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,123
    Yeah this has always been my experience. If I want to profile something it basically means a need to kick off a fresh build (build and run) for the editor to see the device. I don't know exactly what breaks it, but it breaks often enough that I've long given up on being able to profile an existing development build on my device. Always new build. :p

    This has also been my experience across multiple android devices and across multiple workstations. I guess everyone just puts up with it.
     
  21. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,432
    A good set of fixes that should stabilize the Profiler Connection has landed on 2021.2 and is getting backported to 2020.3. the backports might take a moment though as it's a bit of an extensive set of changes that needs thorough vetting.
     
    Extrys likes this.
  22. regystutorials

    regystutorials

    Joined:
    Jan 31, 2021
    Posts:
    3
    Use only Build and Run, don't use Build.
     
    beck_unity139 likes this.
  23. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138

    Hi,
    are the fixes out in 2020 ?
    Thanks
     
  24. G_Wojo

    G_Wojo

    Unity Technologies

    Joined:
    Feb 8, 2017
    Posts:
    44
    Hi, sadly they are still not. Changes that we bringing, are not small and top of that Unity 2020 code differ a lot from later versions so we encounter some problems while doing the backport. The good news is that we believe it is worth the effort and we resolving problems one by one so we could finally land this portion of fixes and move to next batch.
     
  25. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Thanks, I already installed unity 2021 and will use its profiler ( without upgrading my project to unity 2021 ), should this work ?
     
  26. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,432
    it should work but would not resolve all connection issues, as those exist on both sides of the connection. IIRC there is only a small set of things that get better by just upgrading the Editor that does the profiling.
     
  27. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138

    This feature seems to be a life saver, thanks for suggesting it, because the profiler is not connecting to my oculus quest
     
  28. maxestws

    maxestws

    Joined:
    May 17, 2014
    Posts:
    24
    Make sure to enable Development Build:

    upload_2023-3-31_20-53-50.png
     
  29. unity_6F8E618FD67F5D9192AA

    unity_6F8E618FD67F5D9192AA

    Joined:
    Aug 9, 2022
    Posts:
    1
    Turning off the firewall defender works for me
     
  30. sk7725

    sk7725

    Joined:
    Dec 11, 2021
    Posts:
    4
    2022.3.8f1, Oculus Quest Pro. Still recurring.