I started AnywhereRoles back in 2020 as an iPhone app, just for myself. Now it's on iPhone, Android and the web, and the two phone apps share one Kotlin Multiplatform module. I want to tell you where I put the line between shared and native code, because I got it wrong a few times before it felt right.
My rule is simple. If both apps must give the same answer, that answer is computed once, in shared code. If it's about how the app feels, it stays native.
Here is where it paid off. Each job card shows something like "Posted 2 d ago, checked 3 h ago". For a long time Android and iPhone didn't agree on it, because each had its own little rules. Now one shared function decides what to show, and each platform only turns the ages into words with its own date formatter. Same with the small flag next to a job's location. One function reads the free text ("Berlin or Lisbon, EU only"), finds the countries, and picks a flag, a globe or nothing.
The paywall table is the same story: it's just data in the shared module, so if I add a row, both apps get it.
Everything else in the shared module is the usual stuff: database, network, repositories, use cases, and the state each screen shows. Koin for injection. Android draws that state with Compose, the iPhone app with SwiftUI through a few small bridge classes.
I never tried to share the UI. Navigation, sheets, share dialogs, the large-screen layout on Android, all native. Calendar events are a good small example. Android hands the event to the system calendar. On iPhone I use the write-only calendar permission, so the app can never read anyone's calendar. The shared code only builds the title, length and reminder, so both apps make the same event.
Now the parts that hurt.
My CI is Linux only. It checks that the iOS Kotlin code compiles, but it does not run the shared tests for iOS. So a change can pass everything and still break on a Mac. I learned that the annoying way, twice. Now I run the iOS test task on my own Mac for every change in the shared module.
Kotlin/Native is not the JVM, and it doesn't always tell you. A test name with a comma inside the backticks works fine on the JVM and gets rejected by Kotlin/Native. And a regex class that mixes a Unicode letter class with other characters just quietly ignored part of it on iOS. I wrote a small script that looks for both, and it runs in the build.
I also don't build Swift in CI at all. A hosted Mac runner costs way more than a Linux one and one expensive month was enough for me. So I build the iPhone app on my machine before each release. The downside: if I add a Swift file and forget to add it to the Xcode project, nothing tells me until the upload fails. I live with that for now.
If I started again, I'd write down the "both apps must agree" list on day one. I found most of mine by fixing bugs where the apps disagreed. And I'd set up the Mac checks much earlier.
The app is free to browse if you want to see it: https://anywhereroles.com/?utm_source=devto&utm_medium=social&utm_campaign=nov_2026
By the way, I'm available for hire as an Android or Kotlin Multiplatform developer. And if you do things differently, I'd like to hear how, in the comments.

Top comments (1)
The "both apps must give the same answer" rule is a really clean line. The posted/checked age is a great example, because that kind of drift is exactly what users screenshot.
You asked how others do it, so here are two things that close the Linux-only gaps you describe without adding Mac CI:
Run the shared tests on Kotlin/Native on Linux. If you add a
linuxX64()target to the shared module,linuxX64Testcompiles and runs your common tests with the Kotlin/Native compiler and runtime on the Linux runner. Both of the bugs you hit are Kotlin/Native behaviour, not iOS behaviour. The backtick test-name restriction comes from the native compiler, and the regex engine on native is Kotlin's own implementation, the same on every native target. So they'd have failed there. The catch is that every dependency in the tested source set needs a Linux artifact. Ktor, Koin, kotlinx.* and SQLDelight's native driver have one, so it's usually only the iOS-specificactuals you'd stub. It doesn't replace your Mac run before release, but it catches that class of bug on every push.Catch the missing Swift file on Linux too.
project.pbxprojis plain text, so a few lines of script can list every.swiftunder the app folder and fail if a file name doesn't appear in the project file. It's crude, but it's exactly the "forgot to add it to the target" case, and it runs in milliseconds. Moving the project to XcodeGen or Tuist removes the problem entirely, since the project gets generated from the folder, but that's a bigger change.And if the repo is public, GitHub's hosted macOS runners don't cost minutes, so a weekly
iosSimulatorArm64Testlimited to changes undershared/would be free.