Search Unity

SRDebugger - On-Device Console, Options Panel, and Bug Reporter.

Discussion in 'Assets and Asset Store' started by Simie, Feb 7, 2015.

  1. glumleaf

    glumleaf

    Joined:
    Jan 30, 2016
    Posts:
    22
    I'm on Unity 2020.1.2f1.
     
  2. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Oh, neat! I will test this and add support for copy/paste in the next update if it works.
     
  3. Revolter

    Revolter

    Joined:
    Mar 15, 2014
    Posts:
    216
    Hey @Simie,

    I'm trying out Dynamic Options, but I'm having exceptions on this line:

    upload_2021-4-5_18-37-8.png

    When debugging, It shows me that op.Property.GetValue() returns a function, not a value
    upload_2021-4-5_18-37-47.png


    I'm using this constructor btw,
    upload_2021-4-5_18-43-20.png
     
    Last edited: Apr 5, 2021
  4. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    This is the same issue that @lastone-iv was having: https://forum.unity.com/threads/srd...-and-bug-reporter.296403/page-12#post-6968564

    There is a fix in the next update I'm working on, but the workaround he suggested will get things working for you straight away if you need it before then.
     
    Revolter likes this.
  5. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    I can't seem to reproduce this issue. Are you seeing this error on a brand new project after importing SRDebugger, or an existing project that you have upgraded to the latest version of SRDebugger?
     
  6. glumleaf

    glumleaf

    Joined:
    Jan 30, 2016
    Posts:
    22
    I was just able to reproduce it in a brand new project after importing SRDebugger. The first thing I did after importing was go to Window > SRDebugger > Settings Window. I then went to the Shortcuts tab and tried modifying one of the existing keyboard shortcuts by toggling off any of the Ctrl, Alt, or Shift options. I then closed the window. Then, if I try opening the Settings Window again, I get the same error that I mentioned before:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.EditorWindow.GetWindowWithRect[T] (UnityEngine.Rect rect, System.Boolean utility, System.String title, System.Boolean focus) (at <d1bec46880064709a5e713ad543e6d96>:0)
    SRDebugger.Editor.SRDebuggerSettingsWindow.Open () (at Assets/StompyRobot/SRDebugger/Scripts/Editor/SettingsWindow.cs:21)


    Actually, testing it a bit more, it doesn't matter what I do in the Settings Window. All I have to do is open the Settings Window, close it, and then try opening it again. I get the error every time I do this. Then if I try opening the Settings Window again (after getting the error once), it opens with all the settings reverted.

    I hope this helps!
     
  7. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    Hi! I'm enjoying SRD so far, thank you!

    One suggestion, because Unity doesn't properly recognize the dpi on newer iOS devices, I use the following in SRRetinaScalar and suggest you add it to the codebase. As you can see, there's zero risk since all iOS devices are well above 120dpi:

    ```
    ...
    Code (CSharp):
    1.  
    2.  ...
    3.             if (dpi <= 0)
    4.             {
    5.                 return;
    6.             }
    7.            
    8.             // Detect if we're on iOS and the resolution is suspiciously poor (because Unity didn't recognize it)
    9.             #if UNITY_IOS
    10.             if (dpi < 120) {
    11.                 dpi = 321;
    12.             }
    13.             #endif
    14.  
    15.             if (dpi > ThresholdDpi)
    16.             {
    17. ...
     
  8. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the repro steps. This still doesn't seem to be occuring to me, I wonder if it might be a platform difference or to do with the version control system you have configured.

    Are you on Windows or macOS?
    Do you use a version control integration with Unity?

    Thanks for the heads up - I'll include the fix in the next version, as there hasn't been a new low-DPI apple device in years.
     
  9. unity_0reQzcJokladhw

    unity_0reQzcJokladhw

    Joined:
    Apr 27, 2020
    Posts:
    2
    @Simie Hi! I just presented your plugin to my company and they loved it, but the notch issue is still there. Any ETA for the notch support?
    -
    By the way, our team came up with a cool feature idea: cheat group filters in the sidebar.
    I've already implemented that for us, thanks to the plugin opensource, just sharing the idea in case you'll want to include it in the plugin. Very handy for when you have a lot of cheats.
    upload_2021-4-29_11-14-32.png
    -
    Another thing people suggested while I was demoing the plugin:
    Ability to change the UI scale of the panel in the panel. (It was easy to implement though, your code is easy to read!)
    -
    Finally, some people didn't like the font so I had to go through all the prefabs and swap the font. Maybe you could add a setting, so it would be possible to change the font in the setting window quickly?
    ---
    In any case, the notch support is the only thing I really need, and the rest is just sharing of ideas and thanking you for a nice plugin!
     
  10. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    Hi @Simie and SRD friends,

    Sorry if this is a dumb question but Debug.Info(string) entries do not appear at all in SRD when I do a release (non-development) build. When I do a development build, they show up as expected. I can reproduce on macOS and iOS and have not confirmed on Windows.
     
    Last edited: May 2, 2021
  11. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the suggestions, very cool to see people modifying the panel to suit their needs! Notch support is high on my list of priorities and I will make every effort to get this in for the next major update.

    Hey! This is a bit odd, the logs should be available in all builds regardless of whether development mode is enabled or not. Do you mind if I ask what version of Unity you are seeing this on? I can't seem to reproduce this on Windows standalone / 2020.3.6.
     
  12. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    2021.1.5f1
     
  13. gbsslab

    gbsslab

    Joined:
    Jan 13, 2021
    Posts:
    1
    Hi @Simie, I was wondering if it is possible to add another file as an attachment to the bug reporter? Specifically, I would want to add another text file as an attachment and would add this to the json request similar to the console log and the picture attachment. I was not sure what happens once the request leaves unity. Are you maybe looking for and parsing only a specific format and then having the email sent out?
     
  14. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    Hi @Simie, is there any update or info on this?

    This issue makes SRD useless for deployed apps under 2021.1, please advise, thanks.
     
  15. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hey drew, sorry for the delay. I'll be looking into this in more detail this weekend, and working on support for notch displays.

    Has been a busy time with other projects but should have a solid block of time to work on SRDebugger in the coming days.

    Hi, I'm afraid this won't be possible using our server. However you can change the endpoint SRDebugger uses to send bug reports to point at your own server, if you want to implement this yourself. I am also planning to implement a more modular "bug reporter provider" interface so you won't need to modify internal SRDebugger code to do this in future.
     
    drew55 likes this.
  16. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    Sorry for question, in the console windows how can I anchor the final logs? (For exaple I receive an log for update but in the console I want see the final logs)
     
  17. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hey @drew55, I've been unable to repro this issue on my iPhone with a brand new project (latest SRDebugger, Unity 2021.1.7f1). This is with a non-development build built for release in XCode.

    Do you have any custom code or other plugins that may be overriding the default Unity log handling? e.g. assigning a custom log handler to Debug.unityLogger.logHandler (https://docs.unity3d.com/ScriptReference/ILogger-logHandler.html )

    Hey, sorry I'm not entirely sure what you mean by 'final' logs.
     
  18. drew55

    drew55

    Joined:
    Dec 13, 2017
    Posts:
    44
    Hi @Simie , yes I have confirmed a component was turning off logs for a release build. So sorry for the trouble and look forward to supporting SRD in the future. Thanks!

    Drew
     
    Simie likes this.
  19. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hey everyone, work on the next version fo SRDebugger is nearing completion. I'm just testing the changes to ensure everythign still works as intended before submitting to the asset store.

    Here is a preview of the change log for the next update:

    1.11.0
    ----------

    New:
    - Initial support for notched displays (safe area)
    - Copy log message / stack trace to clipboard (on supported platforms)

    Changes:
    - Improvements to UI scaling behaviour on high-dpi phone displays
    - Display warning at runtime when issues are detected with log message callbacks
    - Expanded input area for scroll bar on console view (easier to drag on touch screens)
    - Added additional graphics info to system tab
    - Press and hold "refresh" button on system tab to activate updating entries every frame
    - (Editor) Cleanup and restore SRDebugger after domain reload when in play mode (script recompile)

    Fixes:
    - Fix exception when adding custom option entry via property getter
    - Fix exception when opening settings window a second time
    - Additional fixes to support enter play mode without domain reload
     
    Last edited: Jun 3, 2021
    Revolter likes this.
  20. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hello, the SRDebugger 1.11.0 has been approved and released on the asset store! I have updated the changelog in the previous post with the final changes. Please let me know if you encounter any issues.
     
    Revolter likes this.
  21. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    Hello, I just upgraded to 1.11.0 on Unity 2019.4.28f1 on Windows and I started to get these errors when starting SRDebugger

    upload_2021-6-7_9-22-8.png

    I hope you can help me with this.
    Thank you
     
  22. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    305
    This turned out to be an Unity bug in which imported prefabs are losing their internal references, strange thing is that when you open the prefab the references are there, so just had to click on save again to reflect that.
     
  23. Kevin_Heng

    Kevin_Heng

    Joined:
    Jun 9, 2021
    Posts:
    1
    Hi Simie, I saw that you mentioned this back in 2016 but I just wanted to confirm that the current version of SRDebugger does not support solo-gamepad input? Been trying to get this to work on my project and having problems before I stumbled upon this forum
     
  24. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    I am glad the issue seems to have resolved itself - this is certainly a strange problem, I'm not sure if there is anything I can do on my end when putting out updates to SRDebugger to avoid this. Usually SRDebugger updates do not involve many updates to prefabs so that might be why it's only happened this time around (a large number of prefabs were changed in the last update).

    Perhaps clearing the Library folder might have helped, since opening/closing the prefab was enough to fix the issue?

    No changes to gamepad input I'm afraid. I have been more careful setting up the navigation to avoid unintentional gamepad inputs triggering SRDebugger (e.g. joystick inputs focusing the panel trigger), but it's not officially supported as an input method.
     
  25. spicybat

    spicybat

    Joined:
    Jul 28, 2019
    Posts:
    3
    Does SRE Debugger work with Unity Cloud Build? I've imported the tool and it works fine on editor, but when I open a build from UCB, taps on the top left corner don't trigger the debugger.
     
  26. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hi @spicybat, there should be no issue with SRDebugger on Unity Cloud Build (in fact there should be some information from the cloud build manifest displayed in SRDebugger).

    Do you maybe have the trigger behaviour set to "developer builds only"? This would prevent the trigger being useable on non-development builds.
     
  27. Can-Baycay

    Can-Baycay

    Joined:
    Dec 14, 2010
    Posts:
    27
    Just a quick optimization request. The line "new WaitForEndOfFrame()" generates garbage in
    SRPProfilerService.cs.

    Code (CSharp):
    1. IEnumerator EndOfFrameCoroutine()
    2. {
    3.     while (true)
    4.     {
    5.         yield return new WaitForEndOfFrame();
    6.         ...
    7.     }
    8. }
    That would be great if you can cache it. Something like:

    Code (CSharp):
    1. private static readonly WaitForEndOfFrame WaitForEndOfFrame = new WaitForEndOfFrame();
    2.  
    3. IEnumerator EndOfFrameCoroutine()
    4. {
    5.     while (true)
    6.     {
    7.         yield return WaitForEndOfFrame;
    8.         ...
    9.     }
    10. }
    11.  
    Thanks!
     
    Simie likes this.
  28. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    You know, I was 99% sure I had already made this optimisation but apparently not!

    I will include this in the next update - thanks for letting me know about it.
     
    Can-Baycay likes this.
  29. Vince-Chimp

    Vince-Chimp

    Joined:
    May 28, 2018
    Posts:
    43
    Hey,

    I am using the latest (1.11.0) version of SRDebugger, and i noticed that in BugReportApi.cs, you are using outdated Webrequest error handling code. Meaning it will throw warnings to end users about this outdated code when using unity 2020.3 at least (possibly other editors as well)
    Can you get that resolved so i don't have to suppress/fix it myself?

    Sincerely,
    Vince
     
  30. protoCorey

    protoCorey

    Joined:
    May 4, 2021
    Posts:
    13
    Hi, we are using assembly definitions and have added our debug options manually using the API, but the issue seems to be that we have no way (without the partials) of triggering the OnPropertyChanged callback. Is there a way to do this through the instance?
     
  31. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the heads up, will get this fixed.
    If you are adding an options container then you can implement INotifyPropertyChanged to let SRDebugger know when a property has changed.
     
  32. TiagoTFG

    TiagoTFG

    Joined:
    Jul 3, 2018
    Posts:
    7
    Hi, thanks for the updates! A piece of feedback is that the scaling seems to be exaggerated on 450dpi+ devices. For reference, on my iPhoneX I can see only two buttons on the right panel without scrolling (System, Console), they are giant :p

    Another suggestion is to improve the support to moving the whole asset to the /Packages/ folder (in line with UPM-distributed packages). One issue we have fixed internally is the way Settings.asset is read/created (doesn't work on read-only directories), but there are a few others.
     
  33. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    I'll take another look at DPI scaling for the next update - the last update included some major changes to how it was being handled so I may have just overlooked some device configs.

    I'd love to have SRDebugger distributed as a package, just for the benefit of being able to add/remove/move files around and have old versions linger on end-user machines when the package is reimported. At the moment though I don't think I can pull off moving SRDebugger to a new folder without introducing some major friction during the upgrade step.

    Unity have been murmuring about migrating the asset store to use UPM, so if that were to happen I would 100% be converting to a package, but until then I'll have to leave it alone I'm afraid.

    I can look into fixing that settings asset though - possibly detecting if SRDebugger is in the packages directory and using an alternative location if so.
     
  34. Trost_

    Trost_

    Joined:
    Dec 12, 2015
    Posts:
    17
    @Simie Hi!
    First of all, thanks for bringing in more and more updates to an already amazing plugin!
    I'm very excited to see the addition of
    SRDebugEditor.SetEnabled(false);

    I've experimented with it and compared build sizes:
    Build before importing SRDebugger: 62.77mb
    Build with SRDebugger enabled: 63.42mb
    Build with SRDebugger disabled: 63.04mb

    As you can see, even if I call SetEnabled(false), it has some effect, but doesn't cut out all of the SRDebugger.
    For me the expected result would be that the build with SRDebugger disabled would be the same size as build before SRDebugger import.
    I've looked at build logs and I can see that a lot of SRDebugger code is still included into the build.
    Here's some (but not all) of it:
    upload_2021-8-30_13-18-28.png
    I checked those files and I can see that they're not wrapped in a build define, like some other files.
    Is there some reason for this?
    For our game it's critical that production builds are as light as possible and to guarantee that the SRDebugger will not impact prod builds, so we need to cut it out completely on prod builds.

    Can you please let me know why are some files not inside of
    DISABLE_SRDEBUGGER
    defines and if there are some hidden problems that will happen if I do so?
    Can we expect an update (or do it ourselves) with 100% coverage of
    DISABLE_SRDEBUGGER
    ? Or it's not possible to achieve due to some reason?
     
  35. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hi Trost, sorry for the delay replying. Do you have code stripping turned on? These classes should not be included in the final build if there are no components or other code referencing them, which is why they are not covered in the DISABLE_SRDEBUGGER tag.

    Code stripping being enabled was a mistaken assumption on my part - I was testing with IL2CPP where it's forced to enabled, but you are right this code should be stripped from non-IL2CPP builds as well where code stripping is not enabled.

    It shouldn't be a problem to wrap everything possible in that DISABLE_SRDEBUGGER tag so I will do that for the next update. Thank you for bringing this to my attention!
     
  36. Trost_

    Trost_

    Joined:
    Dec 12, 2015
    Posts:
    17
    @Simie I made a mistake too, because I was testing on dev build config.
    But I've re-tested again, and even with code stripping, the results are following for me:
    Build before import: 62.45mb
    Build after import: 63.09mb
    Build with import + disable: 62.74mb
    Which means that 0.29mb are still included into the build, even when I disable the plugin.
    But maybe im doing something wrong.
    In any case, looking forward for an update with everything wrapped in a define! Thanks for the support!
     
  37. cubaschi

    cubaschi

    Joined:
    Oct 23, 2012
    Posts:
    51
    Hey. Totally love the tool.
    I'm trying to add another options tab. I know I can create a new one by adding a prefab to the ressources/etc//tabs folder.
    Is there an (easy) way to use the SROptions.xxx system and designate which options tab gets which buttons/functions?
    I hope my question makes sense.


    Thanks,
    Simon
     
  38. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Hey Simon, there's probably not an easy way to do this atm without some script changes. You could look into copying the existing OptionsTabController to check for an attribute on an option before creating a control for it, and making a new copy of the controller that checks for a different attribute.

    I do have a todo item to create a tab interface for the options panel to help organise things in a future update.

    Cheers,
    Simon
     
    cubaschi likes this.
  39. cubaschi

    cubaschi

    Joined:
    Oct 23, 2012
    Posts:
    51
    Hey Simon ;)

    That's perfectly fine for me. Works. I'm just using Category keywords to separate them.

    Thanks so much.

    Simon
     
  40. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Hey @Simie do you have any plans with allowing the font to be configurable? If not, how difficult is it to change?

    Thank you!
     
  41. Trost_

    Trost_

    Joined:
    Dec 12, 2015
    Posts:
    17
    For me it took around 15-20 minutes to replace font in all prefabs. But maybe there's a better way.
     
  42. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Thanks! Hopefully it doesn't come to that. I'd rather not make changes since future updates might wipe them out. But then again, that font isn't great.
     
  43. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    I'm sure it's not a supported approach (by Stompy Robot or Unity) but I've changed fonts before (in-place) by using a rename\replace approach.

    So...

    1. Rename existing "Orbitron X" fonts to a common name (i.e. "Default X") in the Unity
    2. Overwrite "Default X" font files with new your font files (in the OS)
    3. Re-import font in Unity
    4. Rebuilt atlas in Unity

    That way you can switch out fonts multiple times without changing everything.

    I've certainly not seen any side-effects to this approach, but no guarantees mind. Just backup first and check thoroughly after :)
     
    jimmying likes this.
  44. StefanEdurino

    StefanEdurino

    Joined:
    Jun 29, 2021
    Posts:
    18
    Hello. Great asset. 2 small issues though:

    I added a bool cheat and now when removing containers I get the following error:
    [SRDebugger.Options] Error binding to property in CreateDataControl method.
    [SRDebugger.OptionsTab] Failed to create option control for IsEasy

    I also get this error each time loading scenes:
    Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
    The following scene GameObjects were found:
    SR_Indicator
    Category(Clone)
    SR_BG
    SR_Indicator
    SR_BG
    Category(Clone)
    SR_SelectionToggle
     
  45. StefanEdurino

    StefanEdurino

    Joined:
    Jun 29, 2021
    Posts:
    18
    I see it was throwing an error when it was trying to get the value of the property:

    var currentValue = _prop.GetValue();

    So I added a backing field and now it works.
    Code (CSharp):
    1.  private bool _isEasy = false;
    2.         [Sort(2)]
    3.         [Category(CategoryName)]
    4.         public bool IsEasy
    5.         {
    6.             get => _isEasy;
    7.             set
    8.             {
    9.                 _isEasy = value;
    10.                 GetRegisteredInstance<ICheatMiniGameDifficultyModel>()
    11.                     .SetDifficulty(!GetRegisteredInstance<IMiniGameDifficultyProvider>().IsEasy.Value);
    12.             }
    13.         }
     
  46. Trost_

    Trost_

    Joined:
    Dec 12, 2015
    Posts:
    17
    @Simie Do you have ETA for the next update? I'm deciding if I should wait a bit more or maybe add DISABLE_SRDEBUGGER defines everywhere myself in our project for now.
    I wonder if there's a way to somehow "subscribe" to be notified about asset update, instead of checking the store page every week.
     
  47. ezerkal

    ezerkal

    Joined:
    Sep 8, 2017
    Posts:
    1
    I get freeze for rebuilding dynamic options.
    When I need change dynamic options.
    I use for removing old 6 options
    Code (CSharp):
    1. SRDebug.Instance.RemoveOption(option);
    and add new 6 new options
    Code (CSharp):
    1. SRDebug.Instance.AddOption(option);
    And I get freeze on 5 - 10 sec while calling these methods.
    version 1.11.0
     
  48. Simie

    Simie

    Joined:
    Oct 26, 2012
    Posts:
    456
    Thanks for the heads up - I will work on optimising the listeners to option add/remove events so they don't cause this freeze.

    I'm aiming to have the next update out in mid-November. Sorry it's taking so long.
    I can look into this, but I would also be open to changing the default font if you have a suggestion for a better one.
    Did you have a getter before? I can look into improving this error message so it's more obvious that a getter is missing.

    Are you still seeing the issue with "Some objects were not cleaned up when closing the scene."? SRDebugger's game objects are parented to an object that is not cleaned up on scene load, so this should not be happening. Are you doing any custom cleanup of game objects when changing scenes?
     
    Trost_ likes this.
  49. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    I think any common san-serif font is good. Even just the default Unity font is fine. Because SRDebugger is a tool, the font doesn't need to look good, so I think accessibility is more important. So the more common/boring the better.
     
  50. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    303
    Hi, On the device I'm deploying to I can't use the mouse, Only keyboard (Or Controller).

    So how do I toggle on/off those buttons?


    upload_2021-11-13_17-29-25.png

    I want to assing keys to them

    I already implemented something like this

    if(Input.GetKeyDown(KeyCode.Space))
    {
    SRDebug.Instance.ShowDebugPanel(DefaultTabs.Console);
    }

    To show the console, but haven't figured out yet how to access those.
     
    Last edited: Nov 14, 2021