> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revyl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Kotlin Multi-platform (KMP)

> Run the dev loop on a KMP project

KMP projects share business logic in Kotlin across iOS and Android while
building native binaries for each platform. Revyl detects the KMP layout and
uses the native iOS or Android build command underneath a rebuild-based dev
loop. KMP is a layout signal, not a supported `build.framework` value.

The CLI detects KMP projects by looking for a `shared` module alongside native
shell directories (`iosApp`, `androidApp`, or `composeApp`) and KMP-specific
Gradle markers. If exactly one native platform is present, init authors a
platform-oriented profile using the inferred native command or a placeholder
for you to complete. If both are present, init writes project and session
configuration only; configure the native apps as separate Revyl projects
rather than authoring legacy `build.system` or `build.platforms` fields.

KMP does not have its own hot reload runtime. The dev loop uses the same rebuild model as native iOS/Android: press `[r]` to rebuild the full binary including shared Kotlin code, upload it, and reinstall.

### What `revyl init` shows

When KMP is detected, the CLI explains the mapping:

```
Detected: Kotlin Multiplatform
  Shared module: shared/
  Platforms: ios, android
  Note: Shared KMP logic compiles into native iOS/Android binaries.
        The dev loop uses native build commands underneath.
  Writing project and session configuration only; no build profiles were added.
```

### Manual configuration

If auto-detection does not trigger (e.g. a non-standard project layout), configure the native builds manually:

```yaml theme={null}
build:
  framework: ios
  profiles:
    development:
      ios:
        build_commands:
          - "cd shared && ./gradlew assemble"
          - "cd iosApp && xcodebuild -workspace iosApp.xcworkspace -scheme iosApp -configuration Debug -sdk iphonesimulator -derivedDataPath build"
        output_path: "iosApp/build/Build/Products/Debug-iphonesimulator/*.app"
```

For an Android app, use `framework: android` and an `android` recipe in that
app's project config. `build_commands` is always an ordered list, even when the
recipe has one command. Run `revyl config validate` after authoring it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.