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

kevinskrei

11/30/2018, 5:54 PM
Hi Friends, new here. I'm an Android dev and I am looking to make some cross platform code work on both iOS and Android. My company has some straight business logic (no platform API's needed) duplicated on both platforms. I took a look at docs and am a bit confused on the different types of projects I need to use (apple framework, dynamic library, etc) as I don't need any UI or platform specific resources. I've tried out the mpp-ios-android sample and it appears that I can debug the native android code in Android Studio but cannot debug the generated iOS framework from xcode. I'm not sure if it's my unfamiliarity with iOS frameworks, I need a different IDE, I'm generating the wrong type of iOS framework from kotlin native (do I need a dynamic library), or its just not possible to debug the generated code? Based on the searching I've done on this thread I'm reading that debugging might not be supported yet? Thank you
s

Sam

11/30/2018, 6:28 PM
I don’t think you can step through the code in Xcode line by line. There are some lldb commands you can find in your .konan folder. I haven’t tried them out so don’t know how helpful they are. Be careful navigating the compiler folders in MacOS Finder. It will leave .DS_Store files everywhere and that messes with the compiler causing it to error out. I ended up running a find command from the terminal to delete them and all was well.
k

kevinskrei

11/30/2018, 9:58 PM
Thank you for the info. I'll be sure to check that out.
@Sam I am successfully able to print out some kotlin variables from the konan-lldb in xcode. Forgive my ignorance, is there a possibility to set breakpoints somehow in the native code? I'm not even sure exactly what that means as I can't view any native code because its in a framework. Is there a way to decompile the framework into native code and set some breakpoints even without being able to step into them?
s

Sam

11/30/2018, 11:52 PM
I am not aware of any way to step through kotlin native code.
o

olonho

12/02/2018, 10:18 AM
Debug info is generated, so single stepping shall work in CLion or in console lldb
k

kevinskrei

12/03/2018, 12:05 AM
Thank you @olonho. Do you have any guidance on how to debug the generated code in lldb? I can print variables but when I try to "step in" to native code (
s
in lldb) it just steps over the command instead of entering the native iOS framework. Is there something I must setup to get this working?
2 Views