Home/Without a Mac/How do I debug a Kotlin Multiplatform iOS app on a simulator or device without a Mac?

How do I debug a Kotlin Multiplatform iOS app on a simulator or device without a Mac?

Updated · airankrush

The short answer

Short answer: debug shared logic on the Android and desktop targets first, which can stay on Windows. Compose Hot Reload currently supports only the desktop target as well. What has to go on a Mac is the iOS simulator. The official device steps need a cable to the Mac, which a remote setup cannot do.

Which steps require macOS

What can stay on Windows or Linux

  • Business logic in commonMain: run it and set breakpoints on the Android or desktop (JVM) target.
  • UI iteration for Compose Multiplatform. The official docs say Compose Hot Reload currently supports the desktop target and suggest using the desktop app as a sandbox for quickly adjusting UI in common code. In other words, the high-frequency loop of UI changes was never meant to happen on iOS.

What must be on macOS

  • Running in the iOS simulator. In the docs' words: iOS apps run on a simulator, which requires a macOS machine with Xcode installed.
  • Platform-specific implementations in iosMain, interop with Swift, and how the UI behaves on iOS (safe areas, gestures, keyboard).

What a remote Mac cannot do

  • The official physical-device flow. The steps in the Kotlin docs are: connect the iPhone with a cable, turn on Developer Mode on the phone, and complete pairing in Xcode. A phone cannot be plugged into a machine that is not next to you.

How to do it on a remote Mac

  1. Confirm a simulator runtime is installed

    Launch Xcode on the remote Mac. Per the Kotlin docs, go to "Xcode | Settings | Components" and confirm at least one iOS simulator is installed. Menu names may change between Xcode versions.

  2. Run on the simulator from the IDE

    In IntelliJ IDEA or Android Studio, pick the iOS entry in the run configuration list, pick a simulator in the device list next to it, and click Run. The docs recommend the run configurations provided by the plugin over the generic Gradle build task: the former builds only the relevant target, while the latter compiles Debug and Release versions of every target.

  3. When the run configuration reports no available devices

    The troubleshooting direction given in the docs: launch Xcode and check whether there are iOS SDK updates to install. Not having opened Xcode by hand after an upgrade is the most common cause.

  4. Debug platform-specific code

    For debugging support of iOS run configurations in the IDE's Kotlin Multiplatform plugin, follow the JetBrains docs. Code on the Swift side is debugged in Xcode: open iosApp with "File | Open Project in Xcode" and run it. The Kotlin docs say that debug builds from Xcode automatically generate binaries with debug information.

  5. Move high-frequency UI tweaks back to the desktop target

    If the project includes a desktop target, look at UI changes first in the local desktop app with Hot Reload, and once they settle, confirm the iOS differences in the simulator on the remote Mac. This keeps your dependence on remote desktop smoothness to a minimum.

  6. Verify on a real device through TestFlight

    Upload following signing a KMP app and uploading to TestFlight, then install on your own phone. Keep the dSYM so the Kotlin stack traces in crash reports are readable. For why no breakpoints are available, see can a remote Mac debug on a real device.

FAQ

How do I track down a crash that only happens on iOS?

Reproduce it in the simulator first and read Xcode's console. For crashes that only happen on a real device, collect crash reports through TestFlight. Symbolication needs the dSYM, and the Kotlin docs say the Release framework includes that file by default.

Can unit tests for the iOS target run on Windows?

No. Running tests for the iOS target requires building a final binary for an Apple target, and the Kotlin docs state that this cannot be done on Linux or Windows. Tests for common code can run on the JVM or Android target and cover most of the shared logic.

Does Compose Hot Reload work on the iOS simulator?

The official docs currently only describe support for the desktop target and say other targets are being explored. Follow the latest statement in the Compose Hot Reload docs.

What if my app relies heavily on hardware such as Bluetooth or the camera?

Features like these need step-by-step debugging on a real device, which a remote Mac cannot provide. You need a Mac within arm's reach. For deciding between renting and buying, see rent or buy a Mac just for building and publishing.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All no-Mac guides