Anyone know how to check for whether Kotlin Multip...
# announcements
j
Anyone know how to check for whether Kotlin Multiplatform project code is being run with the IDEA debugger/console attached? I have a test method that loops with a timeout if it takes too long, but when I leave the time elapsed checker in the loop, my breakpoints never get hit when running/debugging tests in IDEA.
y
Maybe try just including a breakpoint in a place that you're 100% sure will get called just to check if debugging works? Like put a breakpoint on the first line in
main
or something
j
Ah I don't think I was very clear in my question. The goal isn't to verify whether debugging works or not. The goal here is to write some code that will only execute when running in the debugger. Like:
Copy code
if (isIDEADebuggerAttached) {
    ...Do something...
}