Is there a way to export objects from the Android Studio (IntelliJ IDEA) debugger. For example Visual Studio has Object Exporter
In the end I need to create/generate objects initialized with values that are based on server responses. So any other solutions to achieve this end are also welcome.
This is probably more cumbersome than what you would like, but the following does work:
Create a custom data type renderer as @Donn_Felker mentioned. Assuming that you have a class on the classpath that can serialize an object to JSON (or some other format in which you are interested), use that object in the data type renderer to produce a String containing the serialized data.
In my case, I have a class in my project name GsonProvider, which is essentially a Factory class for Google's GSON. The expression that I use in my data type renderer is: com.example.GsonProvider.getGson().toJson(this)
The class name needs to be fully-qualified.
It would be nice if you could use this just when 'rendering' the inspected node, but unfortunately, while you can see the serialzed value there, there doesn't seem to be any way to copy it to the clipboard or export it in any way.
So, add the expression to the 'when expanding the node' section. I was able to make this work by choosing "use list of expressions", and then adding an expression with the name "json", and a value of com.example.GsonProvider.getGson().toJson(this)
I save my custom renderer with the name "json".
With that in place, you can right-click on a variable in either the 'variables' or 'watches' window, and select "View As" --> json, and you will see it as a json string. Right click on it, and choose "copy data". This will copy the json string to your clipboard.