Hello everyone, what's the latest on debugging mul...
# multiplatform
c
Hello everyone, what's the latest on debugging multiplatform code from the iOS side? Touchlab's kotlin XCode plugin allows you to view Kotlin source but we don't have our iOS and kotlin projects colocated. Is there a way to get source maps from the ios framework so that I can set breakpoints in XCode and step into the kotlin side?
Hmm.. I think I misunderstood the point of xcode-kotlin plugin. I think it does support setting breakpoints in a framework.
h
@curioustechizen were you able to get the breakpoints working?
c
I'm trying with AppCode at the moment. Will get back to XCode in a day or two.
👍 1
But I think in general with XCode it does work - I'm seeing blog posts that it does
h
thank you.. I am trying get this working for both IntelliJ(Android /JVM) and XCode. Our KMP code is also not embedded in the same Android/iOS code, will update if that works for me
👍 1
c
The problem might be related to my project structure though. I have
my-app-android
which includes
app
and
multiplatform
modules; with
multiplatform
including all the multiplatform build.gradle magic (and cocoapods plugin). Then I have separate
my-app-ios
which is next to
my-app-android
. The Podfile in
my-app-ios
points to the
../my-app-android/multiplatform/multiplatform.podspec
This is different than all examples I'm seeing where everything is colocated
h
yes, in our case we have individual repositories for Android, iOS, Web and KMP and there are not much example / tutorial for it. will write my own if I can find time
c
I suspect it is something to do with the dSYM file but my knowledge of this is very limited
🤷‍♂️ 1
k
The AppCode debugging used the lldb scripts from kotlin-native, which were designed for cli debugging. If you had, say, an array of 100k elements, you might as well force quit the process, as debugging would be impossible. If you swapped out the lldb script with the one from the xcode plugin, which is again lightly modified to support gui programs, it would work better. However, I’ve seen very little discussion of AppCode lately, so I’m not sure if that’s been updated much.
c
Thanks for the explanation! When you say "_*you can only debug code that you’ve compiled locally"*_, do you mean not downloaded from a remote cocoapods repo? I mean I can still have the projects located in different locations in my file system; and then "Add files to Xcode" (without copying the files) to be able to open Kotlin files in XCode? As long as the relative path to the podspec in the Podfile is correct, things should work - is that right?
Okay I see you already answered this in the other thread - the answer is we need to use a dynamic framework instead of static one; and cocoapods plugin does not support it for now, so we could look into KaMPKit or elsewhere to make it a dynamic framework.