Debugging coroutines and threads


#1

Just read the coroutines guide and I can’t wait to try them out in an Android Project I’m currently working on. But one thing is holding me back a bit. I read in the section on debugging that you should run coroutines with the ´-Dkotlinx.coroutines.debug JVM option´. Is there some way to make this JVM option active in your IDE on a specific project, so that you wont have to type it into the terminal every time you want to debug something?

Btw. I’m using Android Studio.


#2

In IntelliJ you can pass vm options under “run configurations” (see top-right near the green play button).


#3

Hi. Could you post instructions or maybe a picture of where this is set?


#4

I hope that these screenshots will guide you to the right place:

run-config


#5

Thank you very much. Really appreciate the help.


#6

Hm, but this doesn’t apply to Android projects. How would you enable debugging there?


#7

Sadly I never found a way to enable it in my Android project.