DEV Community

ColtonIdle
ColtonIdle

Posted on

How to setup compose desktop hot reload

Steps:

  • Use Kotlin 2.1.20-RC (or any higher if released)
  • Apply the plugin
  • Wrap the content of a window with DevelopmentEntryPoint {}
  • Use OptimizeNonSkippingGroups (optional, but a better experience for me).
  • Then in a KMP project and IntelliJ, just using main function run gutter to run the APP.
  • If you're using Kotlin JVM or Android Studio, then configure the jvmRun task or provide
  • ./gradlew jvmRun -DmainClass=path.toMain.MainKt

Basically, running compose apps is the easiest if using KMP + IntelliJ.

Note: Must use JVM that is shipped with Intellj. Navigate to Settings > Gradle > JDK and make sure IntelliJ JDK is selected

Top comments (0)