I've been shocked today. Shocked to my core! Been...
# coroutines
d
I've been shocked today. Shocked to my core! Been programming Coroutines for _years_; and always wished the debugger had some kind of view of Coroutines. Well, it does!!! https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-debug/ ...you just need to install this Coroutines debugging agent artifact to 'activate' it. My debugging life will never be the same again. If you ask me, this needs to be made more prominent in Coroutines Docs! Maybe I'm the last one to know, but if anyone else reads this and is equally shocked, my work here is done. Thxbye 🙇‍♂️.
😳 5
image.png
🤯 3
s
Does this work for Android apps as well? IIRC, this was there for a while, but not for Android apps (Art).
d
Not sure @streetsofboston, I used this today for the first time on a JVM Command Line tool I'm building.
But based on what I read in docs, it works as a small runtime server in your App that can gather and report Coroutine related info; so in theory, no different under Android?
c
Android runtime does not support Instrument API necessary for kotlinx-coroutines-debug to function, triggering java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory;, and it is not possible to use coroutine debugger along with Android emulator
😔 6
s
Hmm... I think this is what Google, and not JetBrains, would need to build/change/implement since it deals with the android runtime.
👍 1
o
kotlinx-coroutines-debug has been there for ages, likewise debugger support for it. What's relatively new is this: https://plugins.jetbrains.com/plugin/23117-coroutine-stacks
thank you color 4