https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
w

wuseal

01/26/2021, 7:42 AM
How do you guys debug Kotlin code when running iOS app? Use Android Studio KMM Plugin or Xcode Plugin? Bodys
k

kpgalligan

01/26/2021, 1:20 PM
Those are the 2 options. Personal preference.
w

wuseal

01/26/2021, 1:23 PM
@kpgalligan Can Xcode Plugin could view the properties's value in Kotlin Object? As I described in last issue
k

kpgalligan

01/26/2021, 1:34 PM
Yes
They both use the same base lldb script, but the studio plugin doesn't drill into object for some reason ( which I assume will be fixed soon). Xcode plugin does.
w

wuseal

01/26/2021, 1:38 PM
@kpgalligan Sure, TKS
k

Kris Wong

01/26/2021, 1:47 PM
debugging with KMM never worked for me. I use the Xcode plugin.
😂 1
but really I strive to cover every case by unit tests so I don't have to debug via an app
k

kpgalligan

01/26/2021, 1:49 PM
It's far from perfect. If you're doing a lot of lambdas, or coroutines, the debugging really doesn't work. This is all upstream in the compiler or other toolchain. I'm not an lldb expert, but the Xcode plugin and KMM plugin just set breakpoints and interact with lldb. If the binary data isn't correct/complete, the debugger can't do much.
❤️ 2
I don't debug my code much either, unless it's like a method with a fair bit of logic. Stepping through that works well. Usually it's a Flow listening to the db, with function transforms of 1 to a handful of lines of code. In those cases, the debugger is worthless.
👀 1
I take it back a bit. Just had a reason to use it and it worked pretty good 🙂
👍 1
🙂 1
2 Views