Search Unity

Hdg Remote Debug - Live update / inspector for your phone!

Discussion in 'Assets and Asset Store' started by samizzo, Apr 22, 2016.

  1. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hi @sebas77, yes you can use it on Windows as well!

    Thanks @lorenzodom I'll look into doing a video tutorial on setting it up from scratch, or at least expanding my documentation to include all the steps. Please feel free to leave a review on the store page if you found the tool useful! :)
     
  2. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Hey,

    The plugin works well. In a complex project, auto refresh is too slow so I had to disable it. I want to use it mainly for profiling parts of the game and for this the plugin does the job I hoped it could do. However, even without auto refresh enabled, I can see that the server constantly updates something, altering the profiling. It would be nice to get rid of this problem, but even so it should prove handy to me.

    it would be also super useful to highlight in the game the gameobject meshes selected.
     
    Last edited: Jan 13, 2017
  3. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Thanks for the feedback @sebas77! Yeah it can be slow because it has to gather all game objects which can be slow unfortunately. But I'll take a look at what might be running when auto refresh is disabled. Did it show up in the profiler? It might be the broadcast code which advertises the server to the editor.

    I'll have a think also about the highlighting; that's a good idea!
     
  4. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    to be precise, it's the function RemoteDebugServer.Update that takes up to 7ms on a slow machine. However, strangely, this doesn't happen right at the begin, it happens after a while, maybe if I interact with the editor options. Unluckily this makes my idea to use your plugin for profiling not succesful :(

    Capture.JPG
     
  5. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Woah! With auto-refresh disabled that really shouldn't be happening so there's definitely something wrong there. Thanks very much for that! Sounds like a bug or two have crept in there!
     
  6. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    cool I'll keep an eye here to know when it will be fixed ;)
     
  7. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hey @sebas77 would you be able to email me at sam@horsedrawngames.com with some more info about this bug? I'd like to know:
    • Were you debugging a standalone Windows player?
    • Were you running the player and the editor on the same machine or were you connecting over the network?
    • Did you connect to the player with "Automatic Refresh" enabled, and then disable it, and then the bug occurred?
    • Does the bug occur immediately after a fresh boot up of the game after connecting with Hdg Remote Debug?
    • Does the bug occur if you don't connect with Hdg Remote Debug?
    • Is the "Automatic Refresh" button in the off state in the UI? Does it look like the hierarchy is still updating even though it's off?
    I'm unable to reproduce it yet myself but looking at your screenshot of the profiler there it kind of looks like automatic refresh isn't actually disabled so maybe there's a bug with the client telling the server to stop refreshing.

    Cheers,
    Sam
     
  8. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    1) yes
    2) over the network
    3) I don't remember right now (probably was on), but I just tested again connecting with autorefresh off.
    4) After the connection, without any interaction, the problem is not shown.
    5) no
    6) yes the automatic refresh is off. I don't think the hierarchy was updating

    Result after a normal use session: I am not able to reproduce it anymore! :( (yayyy at the same time :) ). Now the tool is already proving very useful for profiling!

    P.S.: I have another suggestion, can you let me type the name of the gameobject I want to search? It must be more like a string contains search than a string is search.

    P.P.S.: this is not a big issue, since I can easily avoid the symptom, but if I run multiple clients on the same machine, obviously the server will have problems to open a connection on the same port. I am not sure if there is an elegant way to solve the problem detecting that the server is already in use.
     
    Last edited: Jan 18, 2017
  9. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Ah damn! It's great that it's working but not great because there must be a bug there. Oh well, I'll just have to try harder to reproduce it. If you see it again let me know the steps if you can remember.

    The searching thing is a great idea, I'll add that!

    For the multiple clients thing, at the moment if a new client tries to connect to a server which already has a client connected, I just disconnect the new client. The server doesn't support multiple clients being connected at once. However I haven't tested that code in a while, so maybe there's an issue there. I might add a log message or something to indicate that case though so that it's clear!
     
  10. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    currently when two or more clients are open, you will get this in the console:

     

    Attached Files:

  11. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Oh right, sorry I think there is some confusion. By server I mean the RemoteDebugServer which runs in the game, and by client I mean the editor window in Unity. That error message you showed means you're running two instances of the RemoteDebugServer on the one machine. Is that what's happening there?
     
  12. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    yes

    With Unity 5.3 I am having another issue now, apparently if I start the profile AND the remote debugger, I get continuously "Skipping profile frame. Receiver can not keep up with the amount of data sent". I will try to reboot the machine in case it's related.

    I would be useful to start the tool with the automatic refresh disabled ;)

    Edit: rebooting fixed it again, at this point I believe there is something wrong, but it's not always reproducible. In fact, I get the heavy RemoteDebugServer.Update every now and then as well. I will try to find a proper repro.

    Edit 2: the slow Update is happening every time again and I didn't find a reason yet.
     
    Last edited: Jan 24, 2017
  13. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Damn! That "Skipping profile frame" message is from the Unity profiler, and means the game has run out of buffer space to capture profile data. It's probably something to do with the RemoteDebugServer.Update showing such heavy use.

    Thanks so much for investigating. I'll try again to reproduce it. I think I was testing on 5.4 not 5.3.

    I'll save the state of the automatic refresh in EditorPrefs. That way it will persist when the window is closed and reopened etc.
     
  14. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    I hope you don't mind my amount of suggestions, but multiple selection to disable gameobjects at once would be useful (at least for me)
     
    Last edited: Jan 26, 2017
  15. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    No it's all good! I'm putting them all down in my notes! :)
     
    sebas77 likes this.
  16. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hey @sebas77, I just realised one issue: if automatic refresh is turned off but you have a GameObject selected in the tree, it will refresh the components on that GameObject regularly. Did you have a GameObject selected?
     
  17. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    yes! That's actually it! Good find, How can I delesect though? Right now I see a big difference if I select a single gameobject compared to a gameobject with a hierarchy.
     
  18. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    If there is empty space in the hierarchy window, clicking it will deselect.

    In theory it shouldn't matter whether there is a hierarchy or not because it only gathers the components from that one selected GameObject, but I'm investigating this now to see if I can work out what's going on. Do the selected GameObjects have a lot of components, or a lot of properties on the components (e.g. say 10s or hundreds)?
     
  19. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    yes you are right, the hierarchy doesn't matter, but it doesn't happen with all the game objects, that's why I got confused.
     
  20. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Ah okay, I suspect some of the game objects have a lot of components and a lot of serialised fields on the components. I'm working on a fix so that it doesn't refresh if automatic refresh is disabled.
     
  21. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    @sebas77 I've been adding those features you requested (a search filter, multi-select for disabling game objects, and disabling automatic refresh for the components). I should have that done some time this week. Can you PM me your email address so I can send you a beta build to try out?
     
  22. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Version 2.1.3460 is pending review now, so it should be in the asset store in the next couple of days. Thanks @sebas77 for your suggestions and bug reports!

    Here's a summary of the changes in this build:

    New features
    • Added multi-selection of GameObjects in the hierarchy using control and shift. Multi-selected GameObjects can be turned on/off together.
    • Added search filter for hierarchy.
    • Automatic refresh setting is persisted in EditorPrefs.
    • Added BuildHelpers to make enabling/disabling stripping and enabling/disabling Remote Debug plugin DLLs easier in build pipelines.
    Fixes
    • Only log the "address already in use" message for the server enumerator once.
    • Fixed bug where server address popup window was indistinguishable from the remote debug background when using the personal skin.
    • Set script execution order for RemoteDebugServerFactory so it runs as early as possible.
    • Don't refresh components if there is no selected GameObject (fixes 'ArgumentOutOfRangeException').
    • Search through all loaded assemblies for Hdg.RemoteDebugServer type by string name instead of concrete type in case the DLL was never loaded and to avoid pulling in the DLL.
    • Only refresh components when 'refresh' is pressed, if 'automatic refresh' is enabled, if the selection changes, or if a property is changed.
     
  23. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Latest update is live on the asset store! Get it here! If you're at GDC and want to talk Unity, tools, or anything, PM me!
     
  24. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    @sebas77, I've just found a nasty bug that might have been related to the very slow refresh. I've pushed a new build with a fix (and some other fixes and small updates). Hopefully Unity will review it soon!
     
  25. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Version 2.2.3499 is now live! Get it here!

    New features
    • GameObjects will now appear under a node representing the scene that they are in.
    • If a Graphic component is modified, it will now be flagged as dirty, which will force it to refresh itself.
    Fixes
    • Fixed build helper writing out the wrong assembly name for the link.xml.
    • Fixed performance issue when refreshing the tree when there are many GameObjects.
     
  26. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    Yesterday I start developing the remote debugger tool (that can be injected to process) for self use. Today I decided to google the already made solution and found this asset.
    So it's better to google before starting developing something, lol. :rolleyes:
     
    samizzo likes this.
  27. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Haha, wow! Great work though! I see you've built it as a standalone tool rather than integrated into Unity. Was there any reason for that?
     
  28. Stridemann

    Stridemann

    Joined:
    Oct 12, 2013
    Posts:
    251
    Well, when I start developing there was no difference to make it on unity or standalone (also there was no sense to launch unity to get data from that game). But for now I think it's more easier to draw end edit the values in unity way (EditorGUI, drawProperty, etc). It's not a problem to port it.

    Also I wanted to release invoking the functions in game scripts and even executing some custom code on game client side (no, realtime compiler will doesn't work in standalone game, I know the other way)..
    But I dunno why I start developing this.. Just for fun.. or thought that can be used as a remote debugger for our game (if our game tester got a weird bug).. or for some cheat in Osiris game (coz I stuck on map and I had to kill myself to get out from there and pay for that all my inventory items I have, so I can invoke correct function in Inventory script to return back all my lost things coz that was not my fail.. heh))
     
    samizzo likes this.
  29. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hdg Remote Debug is on sale, 20% off, as part of the asset store's biggest sale ever! The sale finishes today so get it before it ends!
     
  30. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hello, I bought your asset and I have problem, so I have sent an email to the address that appears in this forum. Thanks
     
  31. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Thanks, just read it and replied!
     
  32. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Thanks for your answer but I still have problems to connect my iPad to the HDG debug through my ipad, even when both are using the same Wifi connection or using the iPad connected by cable. I have sent you an email explaining this.
    thanks for any help
     
  33. Marcurion

    Marcurion

    Joined:
    Jul 29, 2015
    Posts:
    13
    Hi,

    unfortunately I also have problems with the plugin and my iPad. I tried setting the project to development, connected with USB cable only ,deactivated the firewall of my Mac, connected via phone hotspot (no firewall on device), Set App requires persistent Wifi in Unity. The Unity profiler can connect to my app.

    I am using Unity 5.5, latest plugin version and iOS 9.3

    Do you have any further ideas?

    Regards
     
  34. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Yes, we managed to solve @SpaceRay's problem, and it might be the same for you! It turned out that Unity was stripping out Hdg Remote Debug. To get around this you can place a file called link.xml in the HdgRemoteDebug folder with the following contents:

    Code (csharp):
    1. <linker><assembly fullname="HdgRemoteDebugRuntime" preserve="all"/></linker>
    Don't forget to remove that file when making your final build or else the plugin won't be stripped.

    There is a `BuildHelpers` class in the package which you can use as part of a build pipeline to ensure that Hdg Remote Debug is not stripped. It writes out the above link.xml when you call `BuildHelpers.WriteRemoteDebugLinkXml` and you can remove it with `BuildHelpers.RemoveRemoteDebugLinkXml`.

    I'll make some changes to the documentation to better clarify this.
     
  35. Marcurion

    Marcurion

    Joined:
    Jul 29, 2015
    Posts:
    13
    Hi,

    yeah that did the trick :)
    thank you for your fast response, I guess this plugin will be pretty useful for my game!

    Regards
     
  36. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Awesome that's great to hear! If you do find it useful please feel free to leave a comment on the store page :)
     
  37. camaech

    camaech

    Joined:
    Jun 11, 2017
    Posts:
    3
    The link.xml file was the only way I got this working. But so far the plugin is fantastic!
     
  38. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Thanks for letting me know! That bug surprised me. Previously this wasn't a problem because the RemoteDebugServerFactory class which instantiates the server was referencing the server directly by type, but I changed it to look it up by type introspection instead to avoid the server being compiled into games in final builds. Next update should have some more detailed notes about this in the docs.

    Sam
     
  39. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I've just submitted version 2.3.3511 to the store with the following updates:

    New features
    • Pressing the delete key will now delete the selected nodes.
    Fixes
    • The fields of a reference are now serialised and can be modified (however, the reference itself cannot be changed).
    • Added a default link.xml to ensure Hdg Remote Debug is not stripped by default.
    The default link.xml should stop IL2CPP from stripping the Remote Debug server (but remember to remove it when you make your final build!).

    Additionally this update also adds support for modifying fields on reference types, so for example if you use serialisable classes to store data this will now show those fields. This also means that some fields on shaders and materials and other built-in types will show up!

    Sam
     
  40. ISeidingerReflekt

    ISeidingerReflekt

    Joined:
    Jun 2, 2017
    Posts:
    5
    Hi Sam,
    I am having troubles integrating the debug tool in my project.

    For iOS: as soon as I import the unitypackage (even if i dont add the prefab to the scene), the build is failing with "Failed running /Applications/Unity/Unity.app/Contents/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe --api NET_2_0 -out [...]"

    For Android it works but is unstable, my application is crashing a lot with a segfault error: A/libc(2736): Fatal signal 11 (SIGSEGV), code 2, fault addr 0xf39b8dcc in tid 2768 (UnityMain). I think this only happens during refreshing and might be related to bad network connection

    I am using IL2CPP by the way. Do you have an idea what might be wrong? I would love to use your tool, as I am sure it can make debugging life way easier
     
  41. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hi @ISeidingerReflekt,

    I'm sorry to hear you're having these problems. Can you email me at sam@horsedrawngames.com and send me the full editor logs for iOS when the build fails, and any other Android logs you have that show the full callstack or any other log messages surrounding the crash?

    Can you also let me know what versions of Unity and Android you are using?

    Thanks!
    Sam
     
  42. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    If anyone else is getting that UnusedByteCodeStripper error, I've just pushed a new build to the store which should fix it. Hopefully it will be live soon, so keep an eye out for it!

    If you want to work around it, replace the link.xml that I ship in that version with the the following:

    Code (CSharp):
    1. <linker>
    2.     <assembly fullname="HdgRemoteDebugRuntime" preserve="all" ignoreIfMissing="1" />
    3.     <assembly fullname="HdgRemoteDebugRuntimeUWP" preserve="all" ignoreIfMissing="1" />
    4. </linker>
    Cheers,
    Sam
     
  43. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    There's a new build in review now that fixes the tree hierarchy rendering performance in the case of thousands of game objects. Previously it would really chug and lag, but now it's silky smooth just like the default Unity hierarchy view!
     
  44. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    The update is out! Let me know if there are any issues. This update should solve any performance issues with large hierarchies.

    Cheers,
    Sam
     
  45. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Another update fresh on the store now! This fixes some issues with trying to serialise MonoBehaviours that have references pointing to themselves (which caused infinite loops!), as well as some bug fixes around generic lists of custom structs and classes.

    -sam
     
  46. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    @samizzo is it possible to save component values when tweaking ? Maybe using Unity new preset feature ?

    Thanks
     
  47. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hey @Kiupe,

    At the moment there's no way to save the values to the game objects and components. I'll have a think about how this could work but it might not be possible. The problem is that it's impossible to match up the runtime objects running on the device with the objects in the editor. The instance ID isn't guaranteed to be the same.

    The other option is to do a best guess where Remote Debug could attempt to match up game objects by name and position in hierarchy.

    The presets feature looks interesting - I didn't know about that. Thanks for pointing me to it. I'll see if it can help.

    Cheers,
    Sam
     
  48. mikedg1

    mikedg1

    Joined:
    Jun 8, 2017
    Posts:
    2
    Anyone ever run into an issue where the rotation doesnt show up for a transform. Only position and scale?
     
  49. Cross22

    Cross22

    Joined:
    Sep 26, 2014
    Posts:
    22
    Is there a demo available for Hdg Remote Debug? Looks like it has been a while since the last update and I am reluctant to spend $100 on something that might not work with Unity 2019.
     
  50. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    I'm so sorry, I don't know how I missed your message! If you're still seeing this issue feel free to email me more details at sam@horsedrawngames.com and I'll see if I can reproduce it.

    Cheers,
    Sam