Skip to content

skydoves/compose-hotswan-issuetracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JetBrains Plugin API Discord Profile

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.

How It Works

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.

Issue Tracker

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.

Features

Hot Reload

  • 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 & Preview

  • 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 @Preview composables 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 @Preview function 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.

Design Collaboration

  • 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 Integration

  • 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.

Build Integration

  • Debug only: The Gradle plugin adds the client library as debugImplementation only. Release builds have zero overhead.

Explore the full feature set at hotswan.dev/docs.

Getting Started

1. Install the Android Studio Plugin

Open your Android Studio and navigate to Settings > Plugins > Marketplace, search for Compose HotSwan, and install it. Restart your IDE when prompted.

install

2. Add the Gradle Plugin

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.

3. Start Hot Reloading

  1. Build and run your app on a device or emulator as usual.
  2. Open the HotSwan panel: View > Tool Windows > HotSwan.
  3. Select your connected device and click Start.
  4. Edit any Kotlin file, press Cmd+S (or Ctrl+S), and watch the device update.

Gradle Configuration

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.

Requirements

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.

Documentation

Visit hotswan.dev/docs for the complete documentation.

Getting Started

Hot Reload

Multi-Device & Preview

Snapshot & AI

Reference

Blog Posts

Read about the ideas, internals, and use cases behind Compose HotSwan on the official blog.

Hot Reload Internals

Live Tuning Workflows

Preview & Design

Lifetime License

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.

Release Notes

Check the latest releases and changelogs at hotswan.dev/docs/releases.

Community

Join the Discord server to discuss Compose HotSwan, ask questions, share your experience, and connect with other users.

Find this repository useful? ❤️

Support it by joining stargazers for this repository. ⭐
Also follow me for my next creations!

About

🦢 Compose Hot Reload for Android with Compose HotSwan. Instant UI updates on your running Android app with state preserved.

Resources

Stars

Watchers

Forks

Contributors