Running an IDE with an IDE

JetBrains provides a Toolbox app that can allow you to experiment with different Android Studio and IntelliJ versions. Another way to experiment with different versions of IDEs is to launch them within Android Studio as well! You can accomplish this goal by using the Intellij Gradle Plugin. It allows you to launch an IDE within Android Studio, which will automate the downloading of these versions for you.

  1. Add the IntelliJ Gradle plugin to your build.gradle.kts file (see source) as an example):

    
    plugins {
       kotlin("jvm") version "1.7.0-Beta"
       id("org.jetbrains.intellij") version "1.14.0"
    }
    
    intellij {
       // See https://jb.gg/android-studio-releases-list.xml
       version.set("2022.3.1.18") // Giraffe
       type.set("AI")
       downloadSources.set(true)
    }
    
  2. Create a runIde task:

    image

    image

  3. Set the runIde task to include the jvmArgs:

    tasks.named('runIde') {
      jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006']
    }
    
    tasks.named<RunIdeTask>("runIde").configure {
      jvmArgs = listOf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5006")
    }
    

Jump to step 3 described in the quickstart to attach breakpoints!