# Debug Kotlin with Xcode References - Ben Whitley

DevFeed: [Debug Kotlin with Xcode References - Ben Whitley](<https://devfeed.tech/articles/debug-kotlin-with-xcode-references-ben-whitley-38188.md>)

Original publisher: [Read original article](<https://touchlab.co/debug-kotlin-with-xcode-references>)

Published: 2020-05-13T16:32:10Z

Content type: tutorial

Language: en

Sources: [Touchlab | Enterprise Mobile Innovation & Development](<https://devfeed.tech/sources/touchlab-enterprise-mobile-innovation-development.md>)

Topics: [debugging](<https://devfeed.tech/topics/debugging.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>)

Tags: [code-sharing](<https://devfeed.tech/tags/code-sharing.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [debugging-tools](<https://devfeed.tech/tags/debugging-tools.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

This tutorial explains how to debug a Kotlin shared framework inside an iOS application by adding Xcode file references to the shared library. The framework must be dynamic for breakpoints, function names, and line numbers to work reliably. It also gives steps for adding the commonMain and iosMain directories and notes that Xcode may need to be reopened before Instruments can access the files.

## Source excerpt

I'm going to share a very (very) simple, helpful, little trick if you want to debug a Kotlin shared framework within an iOS application. Adding Xcode references to the Kotlin files in your shared library will enable you to do frequently used development practices, such as setting breakpoints or opening files from a memory debugger. Before getting started though, it's important to note that your shared Kotlin framework needs to be dynamic for these file references to be useful.