ios to android
Use for ANY task that ports or implements Android functionality from an iOS/Swift codebase — including single-feature tasks (BLE scanning, location/GPS tracking, billing, Health Connect, background work, database, one screen), not just full-app migrations. Primary coordinating skill for migrating iOS apps and subsystems to Android (Jetpack Compose, Room, Kotlin Coroutines and Flow, Architecture Components). Handles both full-app greenfield migrations and scoped sub-component feature migrations:
Documentation & Preview
--- name: ios-to-android description: "Use for ANY task that ports or implements Android functionality from\ \ an iOS/Swift codebase \u2014 including single-feature tasks (BLE scanning, location/GPS\ \ tracking, billing, Health Connect, background work, database, one screen), not\ \ just full-app migrations. Primary coordinating skill for migrating iOS apps and\ \ subsystems to Android (Jetpack Compose, Room, Kotlin Coroutines and Flow, Architecture\ \ Components). Handles both full-app greenfield migrations and scoped sub-component\ \ feature migrations: Info.plist permissions and AndroidManifest.xml mapping (Android\ \ 14+ runtime permissions and foreground service types), SwiftUI views and screen\ \ layouts, CoreData/Room, StoreKit/Google Play Billing (in-app subscriptions and\ \ purchases), HealthKit/Health Connect, CoreBluetooth/BLE, CoreLocation/GPS, BGTaskScheduler/WorkManager,\ \ and UserDefaults/DataStore. Don't use for Android-only work with no iOS source,\ \ for converting Android XML Views to Compose, or for building or changing iOS apps." license: Complete terms in LICENSE.txt metadata: author: Google LLC last-updated: '2026-11-14' keywords:
- Android
- iOS
- Swift
- SwiftUI
- migration
- Jetpack Compose
- Kotlin
- Coroutines
- Flow
- Room
- Core Data
- DataStore
- UserDefaults
- Google Play Billing
- StoreKit
- Health Connect
- HealthKit
- Bluetooth Low Energy
- Core Bluetooth
- location
- Core Location
- WorkManager
- BGTaskScheduler
- runtime permissions
- Info.plist
- AndroidManifest
---
This skill guides you through the structured process of migrating an Apple iOS application to modern Android. It provides an end-to-end 10-step engineering methodology that performs deep pre-flight project discovery, establishes Gradle infrastructure, and conditionally loads specialized reference documents from references/ based on the specific subsystems detected in the source codebase.
Objective
To systematically convert an iOS codebase into a clean, modern, and idiomatic Android application powered by Jetpack Compose , Kotlin Coroutines \& Flow , and Android Architecture Components, maintaining architectural integrity and visual parity without legacy Android view bloat, unverified stubbing, or proprietary vendor lock-in.
* * *
Operational Scope Modes
Before taking action, determine which operational mode matches the user's request and workspace:
Mode A: Full Application Migration (End-to-End Greenfield)
- Trigger: The user asks to migrate an entire iOS application from start to finish, or the target directory is empty / contains only a clean starter skeleton.
- Workflow: Execute the full 10-step methodology sequentially (Steps 1 through 10), decomposing the app into multi-package architecture, establishing build configuration, porting all subsystems, and verifying against the final consolidated build gate.
- Mandatory Pre-Migration Subsystem Inspection Gate : Before implementing Android code for any detected iOS domain capability, you MUST explicitly view and inspect the corresponding reference guide in
references/for each subsystem present in the source codebase:
- Architecture \& State : Inspect references/architecture-and-viewmodels.md and references/state-and-reactive-flows.md.
- Screen Layouts \& Declarative UI : Inspect references/ui-layout-swiftui-to-compose.md.
- Navigation : Inspect references/navigation-compose.md.
- Database \& Entities : Inspect references/database-coredata-to-room.md.
- Preferences \& Settings : Inspect references/preferences-datastore.md.
- Runtime Permissions : Inspect references/permissions-runtime.md.
- Health \& Fitness : Inspect references/health-connect.md.
- In-App Billing \& Store : Inspect references/in-app-billing.md.
- Bluetooth LE Sensors : Inspect references/bluetooth-ble.md.
- Location \& GPS Tracking : Inspect references/location-fusedprovider.md.
- Background Tasks : Inspect references/background-tasks-workmanager.md.
> [!IMPORTANT] > Important: This gate is mandatory. Reading SKILL.md alone is not sufficient to complete a migration --- this root document is an index and a set of invariants; the reference guides hold the actual API-level implementation patterns. Skipping them is the single most common cause of mock-stub managers, missing runtime permissions, and non-idiomatic layouts that compile cleanly and then fail review.
You MUST record the list of reference guides you actually opened in .migration/migration_walkthrough.md under a ## Reference Guides Consulted heading. If a subsystem is present in the source app and its guide is absent from that list, the migration is incomplete --- go back and read it before concluding.
Mode B: Scoped Sub-Component \& Feature Migration (Contextual Integration)
- Trigger : The user asks to migrate a specific subsystem, feature, screen, or capability (e.g., CoreData to Room, HealthKit to Health Connect, StoreKit to Play Billing, BLE, or a specific screen) into an **existing Android
project**.
- Bypass Macro Overhead : Do NOT perform a full 10-step audit of the entire iOS repository or generate a full
.migration/feature_specification.md. - Execute the 4-Phase Micro Workflow :
- Target Codebase Convention Discovery: Inspect the target Android project to discover and adopt established architecture, package structure, dependency injection, and state patterns.
- Surgical Subsystem Routing : Jump directly to the relevant supplemental reference guide in
references/for the requested capability. - Scoped Migration \& Integration: Implement the subsystem matching the discovered target conventions and wire it to replace any existing Fakes or stubs.
- Targeted Build \& Test Verification : Verify
./gradlew assembleDebugor run specific unit tests without mutating unrelated modules.
- Anti-Premature-Exit \& Execution Liveness Mandate :
- NEVER exit or yield prematurely on background tasks : If a build or test command (
./gradlew assembleDebug,./gradlew test) runs asynchronously, do NOT output a passive waiting message (such as *"Waiting for tests to complete..."* ) without pending tool calls. In non-interactive runs, ending a turn with no pending tool call ends the task before the build finishes. Either wait synchronously (WaitMsBeforeAsync: 10000) or monitor the task to completion. - A task is NEVER finished without the implementation diff : You must author or update the target Kotlin source files (
write_to_file,replace_file_content) replacing mock/stub implementations with real Android Jetpack/platform APIs *before* concluding.
* * *
Target Codebase Convention Discovery Protocol (Mandatory for Mode B)
When performing a sub-component migration into an existing Android codebase, you
MUST inspect 2--3 existing files in app/src/main/java/ and gradle/libs.versions.toml before creating or modifying files. Adopt the target project's established conventions across these 5 dimensions:
- Package Organization :
- *Layer-based* (
data/,domain/,ui/) vs. *Feature-based* (feature/home/,feature/catalog/). Place new files into the existing package hierarchy rather than inventing an incompatible tree.
- Dependency Injection \& Service Locator :
- Discover how dependencies are provided: Hilt (
@Inject,@HiltViewModel,@InstallIn), Koin , or manual AppContainer / Service Locator pattern. - Do NOT introduce a foreign DI framework . If the target app uses manual DI or an
AppContainer, provide clean constructor injections that plug directly into that container. If it uses Hilt, provide Hilt@Moduleand@Providesbindings.
- State Management \& Concurrency :
- Observe how ViewModels expose UI state: unified
StateFlow<UiState>data classes, individual StateFlows, or ComposeMutableState. - Observe how Coroutine dispatchers are provided (e.g., injected
@IoDispatchervsDispatchers.IO).
- Design System \& UI Components :
- Inspect
ui/theme/and common component directories. If the codebase defines custom composable wrappers (e.g.AppButton,AppCard, custom typography tokens), reuse them rather than falling back to generic default primitives.
- Version Catalog \& Dependencies :
- Inspect
gradle/libs.versions.tomlbefore adding dependencies. If a library family (e.g. Room, Coroutines, Serialization) already exists, reuse the project's existing versions and aliases instead of adding duplicates.
* * *
Summary of the 10-Step Migration Methodology (Mode A)
- Deep Source Audit, Domain Discovery \& Migration Brief
- Subsystem \& Capability Decomposition
- Formulate and Approve Phased Migration Plan
- Project Infrastructure, Gradle \& DI Initialization *(Mandatory Build
Gate 1)*
- Resource Catalog \& Localization Migration
- Local Persistence \& Storage Migration *(Mandatory Build Gate 2)*
- Core Architecture, Concurrency, State Hoisting \& Secrets Handling
- Declarative UI \& Navigation Porting to Jetpack Compose *(Mandatory Build
Gate 3)*
- Hardware, Platform Services \& Background Subsystems
- **Build Verification, Test Porting, Quality Triage \& Walkthrough
Generation** *(Mandatory Build Gate 4)*
* * *
Detailed Migration Steps
Step 1: Deep Source Audit, Domain Discovery \& Migration Brief
Before writing any Android code, you Must perform an exhaustive audit of the iOS source tree.
- Domain Grounding : Deduce the application's true functional purpose (e.g., finance, healthcare, social, productivity) from actual code, data models, and API integrations. Do NOT guess visual motifs or architectures based solely on the app's name.
- Deep Functional Extraction: Pay close attention to all functionality implemented in the source application, including non-obvious logic, background tasks, state synchronization, data flows, and lifecycle edge cases. Do not skim the surface.
- Structure \& Dependencies : Discover targets with
find . -maxdepth 3 -type dand inventory dependencies viaPodfile,Package.swift, orCartfile. - Generate Migration Brief : Produce a formal
feature_specification.mdin.migration/summarizing all features, entry/exit points, data flows, and Android target equivalents. - Consult references/analysis-and-project-audit.md for full audit checklists and the Migration Brief specification template.
Step 2: Subsystem \& Capability Decomposition
Map detected iOS capabilities to Android replacement frameworks. Use the
Heuristic Routing Table below to determine which supplemental reference guides are required for the project. When conducting a full-app migration (Mode A), you MUST inspect the corresponding reference guide for every subsystem detected in the iOS app before writing implementation code.
Heuristic Routing Table (Progressive Disclosure)
| Detected iOS Indicator / Code Pattern | Supplemental Reference Guide | Android Target Architecture | |---|---|---| | import SwiftUI / List / VStack | references/ui-layout-swiftui-to-compose.md | Jetpack Compose (LazyColumn, Row