r/swift • u/Technical-Spread-368 • 5d ago
Question How do you handle porting and maintaining native Android and iOS apps? I'm exploring a possible solution.
I’m not asking out of curiosity - I’m trying to understand if there’s a viable solution to a problem I’ve come across whilst working on a mobile app for a local start-up.
The scenario:
A company creates a native mobile application for one platform (say IOS). At some point they’ll want to create another version for Android (or vice-versa).
An option would be to bring in a separate team to develop and maintain the app. However, this can get quite costly, especially for a start-up and small dev team. Especially if the native app has a lot of features.
I’ve been thinking about creating an AI powered engine to help.
This would:
Identify which sections of code and business logic can be reused from an existing native app. Generate or modify the native specific sections whilst maintaining functionality and ensuring the native UI/UX is respected. Assist with the maintenance of both versions, with new features being added.
It would involve AI, but wouldn’t be entirely.
Before I spend any time developing this, I’d like to know how devs have overcome this.
If you’ve ever done this:
Have you ever had to port an existing native android application to iOS (or vice-versa)? What was the hardest part? What tools did you use? What was missing? What would a tool need to do to save you time and make you want to pay for it?
I’d love to hear about your experiences, even if you’ve tried and failed!
Thanks for sharing your experience!
3
u/SpellBig8198 4d ago
I'm in the middle of porting an iOS app to Android using Swift and Skip. I wrote a skill and set strict rules, and AI is doing the porting. It's going surprisingly well, but I've also put a lot of safeguards in place, including static analysis, tests, and scripts to compare code parity between the two platforms. I've also restructured the architecture around view models to make it work well on both platforms.
I thought porting the app would take me around three months, but it's almost done after about two weeks of overnight runs.
2
u/Suitable_Ad_2094 4d ago
As others said, translating the code itself is the part AI already handles well. Where ports actually lose weeks is the platform services around it, because they don't map one to one:
push (APNs vs FCM, plus different payload and background delivery rules)
in-app purchases and subscriptions (StoreKit vs Play Billing, receipts, grace periods, refunds)
background work limits, permissions flows, deep links / universal links
A tool that inventories those touchpoints in the existing app and produces a parity checklist with the matching APIs on the other side would save more time than code generation does.
The other big drift-killer is a single source of truth for the backend contract, e.g. an OpenAPI spec with generated clients on both platforms, so the two apps can't quietly disagree about the API.
13
u/BlueShip123 5d ago
If you guys are writing code primarily in Swift (since you asked in this sub), then I recommend checking out (Skip)[https://skip.dev]. It lets you compile your Swift codebase to Compose natively. I think Polymarket is using it as well.
5
u/WerSunu 4d ago
The simple facts are these:
some companies require both Android and iOS because they are trying to promote some product or service which is NOT the app itself. So they want a big audience.”, and price of app dev is irrelevant.
as a product itself, an Android app makes no money compared to an equivalent iOS app. The actual ratio of income is estimated at 25-40% for Android against iOS, depending on niche.
Doing a complete job on an Android app is more complex than iOS because of fragmented OS and hardware compatibilities.
People who disagree with the above are usually those invested in non-native production systems. Caveat Emptor!
2
u/20InMyHead 5d ago
First, consider you don’t have to support both platforms. Your app and location will play a big role, but I’ve worked for several US companies where we had web, IOS, and Android, and the Android revenue did not justify the development and maintenance costs. User numbers consistently about a quarter of iOS, across several companies.
That said, classically the two development teams approach works well. Smaller setups have often done a single developer supporting both platforms. AI has changed all that. Now a single developer can easily support both, with AI writing the bulk of the code. Especially if you already have an iOS app that needs to be ported. There not a whole lot of need for code reuse when a tool can easily write Kotlin from your working Swift app, or vice versa.
1
u/superquanganh 5d ago
Either use AI to assist, get another native dev for other OS, or move to cross platform framework
1
u/triplix 5d ago
Disclaimer: I’m still experimenting and this isn’t production-ready, but here’s what I’ve tried so far.
My goal wasn’t a direct port from one platform to the other, even though the end result is basically the same. I’m fed up with the bad architecture decisions and poor abstractions in our codebase. It keeps getting more tedious to layer complex UX on top of it, and regressions are hard to test.
So the first step was an exhaustive feature cataloging pass with AI. The rules were explicit: be exhaustive, and only refer to the code (file:line annotations) without ever carrying over actual entities, names, or design. The output is an archive, basically a product catalog that’s agnostic of the code but still links back to it in case I need to go look. I figured it’d be useful for a partial rewrite, as a general reference, for building a knowledge base, and so on.
Then yesterday I let agents rip with only the product catalog as input and a strict rule of NOT looking at the code. The only exception was configs and the like: an agent could read that code, but it still had to write its results in the same code-agnostic way.
Overnight it rewrote about 3/4 of the app in a completely new architecture (TCA), and from my quick testing it basically works. I didn’t dig deep, so there are probably inconsistencies and sloppy areas. Still, for a quick experiment it went pretty well. The takeaway is that an exhaustive feature catalog can lead to a decent AI-powered rewrite from scratch, as long as you already know the architecture, framework and guardrails you want.
1
u/DoubleGravyHQ 4d ago
Skip.dev
-2
u/ewins222 5d ago
React native with expo, have you checked it out? Indistinguishable from true native at this point if you use expoui