Compose HotSwan is a JetBrains IDE plugin & compiler plugin that enables instant hot reload for Jetpack Compose on "real" Android devices. Edit your Compose UI code, save the file, and see your changes reflected on a real device in seconds, without rebuilding or restarting the app.
Compose HotSwan uses incremental Kotlin compilation combined with runtime class swapping on the Android Runtime (ART) to deliver fast, reliable hot reload on real Android devices. When you save a file, HotSwan compiles only the changed code, extracts modified classes, pushes them to the connected device, and triggers Compose recomposition. The entire pipeline typically completes in under a few seconds. For constant-only edits, it completes in under 50 milliseconds via the literal patching fast path.
For a detailed breakdown, visit the How It Works documentation.
This repository serves as the public issue tracker for Compose HotSwan. You can use this repository to report bugs, request features, and track known issues.
- Bug reports: If you encounter unexpected behavior, crashes, or compilation errors, please open an issue with your IDE version, plugin version, Kotlin version, and steps to reproduce.
- Feature requests: Have an idea for improving HotSwan? Open an issue describing your use case and the expected behavior.
- Questions: For general questions, check the Troubleshooting documentation or the FAQ first.
- Community: Join the Discord server to discuss HotSwan, share feedback, and connect with other users.
- Instant hot reload: Apply UI changes to a running Android app without rebuilding or restarting. Your navigation stack, scroll position, ViewModel state, and
remember {}values all stay intact. - Literal patching: Constant-only edits (string templates, numbers, hex colors, XML resource values) bypass the build pipeline entirely and apply in under 50ms. Ideal for fine-tuning colors, spacing, and copy.
- Broad change support: Modify composable bodies, non-composable functions, modifiers, animation specs, conditional logic, resource values, data class properties, and ViewModel methods. Add new composable functions, reorder existing calls, and edit extension/suspend/vararg functions.
- State preservation: Navigation back stack, scroll position, focus, IME state, animation progress,
remember/rememberSaveable, and ViewModel instances survive every reload. - Multi-module: File paths are automatically resolved to the correct Gradle module. Changes in any module are compiled and pushed independently.
- Kotlin Multiplatform: Hot reload works for the Android target of KMP projects, covering both the Android application module and shared KMP modules compiled into the app.
- Multi-device broadcast: Connect any number of devices and edit once to see changes everywhere simultaneously. Useful for responsive layout testing across screen sizes, verifying behavior across API levels, and demo preparation.
- Preview Runner: Render
@Previewcomposables directly on a physical device in under 0.5 seconds without a full rebuild. Iterate on previews with real device behavior and actual data. - Preview Screenshot: Automatically discover every
@Previewfunction in your project, capture screenshots on a real device, and generate a browsable HTML catalog with module grouping and dark/light theme support. No test code required.
- Snapshot timeline: Every hot reload automatically captures a device screenshot paired with a git diff. Browse the visual history in the IDE tool window, time-travel back to revert code to any snapshot, and export self-contained visual reports for designers to review.
- AI-assisted reload: Use Claude Code, Cursor, GitHub Copilot, or any AI tool that edits files on disk. HotSwan detects file changes, compiles, and pushes updates to the device automatically.
- MCP Server: Connect AI assistants via the Model Context Protocol to iterate on your UI with natural language, seeing each change reflected on the device in real time.
- Agent Skill: Drop-in instruction files (General + MCP variants) that teach AI coding assistants how to use HotSwan effectively, including reload-friendly editing patterns and screenshot/diagnose workflows.
- Debug only: The Gradle plugin adds the client library as
debugImplementationonly. Release builds have zero overhead.
Explore the full feature set at hotswan.dev/docs.
Open your Android Studio and navigate to Settings > Plugins > Marketplace, search for Compose HotSwan, and install it. Restart your IDE when prompted.
Add the plugin to the [plugins] section of your libs.versions.toml file. Check the latest version for the version number.
[plugins]
hotswan-compiler = { id = "com.github.skydoves.compose.hotswan.compiler", version = "version" }Register the plugin in your root build.gradle.kts with apply false:
plugins {
alias(libs.plugins.hotswan.compiler) apply false
}Then apply it in your app module's build.gradle.kts:
plugins {
alias(libs.plugins.hotswan.compiler)
}Sync your project. The plugin auto configures everything for debug builds.
- Build and run your app on a device or emulator as usual.
- Open the HotSwan panel: View > Tool Windows > HotSwan.
- Select your connected device and click Start.
- Edit any Kotlin file, press Cmd+S (or Ctrl+S), and watch the device update.
You can customize the plugin behavior in your build.gradle.kts:
hotSwanCompiler {
enabled = true // Master switch (default: true)
debugOnly = true // Apply only to debug builds (default: true)
}For full configuration options, visit the Gradle Configuration documentation.
| Requirement | Minimum Version |
|---|---|
| Android API | 28+ (API 30+ recommended) |
| IDE | IntelliJ IDEA 2024.3+ / Android Studio Meerkat+ |
| Kotlin | 2.3.0+ |
| Android Gradle Plugin | 8.7.3+ |
See the full Requirements documentation for IDE version compatibility details.
Visit hotswan.dev/docs for the complete documentation.
Getting Started
Hot Reload
Multi-Device & Preview
Snapshot & AI
Reference
Read about the ideas, internals, and use cases behind Compose HotSwan on the official blog.
Hot Reload Internals
- Compose Hot Reload: Real-Time UI Updates on Running Android Devices: How HotSwan eliminates the build-wait-navigate loop and reloads Compose UI changes on a running device in under a second.
- Why Your Android Build Takes So Long for a One Line Change: A deep dive into the Android build pipeline (Gradle, Kotlin compilation, dexing, install) that explains where the seconds go.
Live Tuning Workflows
- Tuning Compose Animations Without Rebuilding: Hot Reload for Dynamic Design: Real-time animation iteration for durations, easing curves, and colors with sub-second feedback.
- Hot Reloading AGSL Shaders Without a Rebuild: A Compose Walkthrough: Every constant inside an AGSL shader and every Kotlin side knob tunable on a running device via literal patching.
- Tuning Compose Themes Live: A Visual Feedback Loop for UI Design: HotSwan Palette uses an AI agent to generate and compare theme variants side-by-side without rebuilds.
Preview & Design
- Compose Preview Renders Differently Than Your Real Device. Here's Why.: Why
@Preview(layoutlib) diverges from real devices, and what that means for design fidelity. - Compose Preview Driven Development with Instant Feedback: Structuring maintainable previews and extending them to on-device rendering with zero rebuild time.
Compose HotSwan offers a Lifetime License for permanent access to all features, available through a one-time sponsorship of $200 or more via GitHub Sponsors. It also includes a lifetime subscription to the Dove Letter newsletter.
Check the latest releases and changelogs at hotswan.dev/docs/releases.
Join the Discord server to discuss Compose HotSwan, ask questions, share your experience, and connect with other users.
Support it by joining stargazers for this repository. ⭐
Also follow me for my next creations!