1

I'm developing an intellij plugin supposed to be used in android studio. I've already setup the plugin development environment, but when I hit "Run" command it starts a new intellij instance with the plugin installed.

What I'm looking for is how to run the plugin directly on Android Studio, is that possibile? The only place where I think it can be configured is from "Run configurations" but I do not find anything useful there.

Thanks

Apperside
  • 3,542
  • 2
  • 38
  • 65

1 Answers1

6

You can specify the platform to run on in the IntelliJ Platform Plugin SDK settings, under Platform Settings | SDKs in the Project Structure settings. Point the IntelliJ Platform Plugin SDK home path to your Android Studio installation.

Another option is to create a new Plugin Run Configuration. In the Run Configuration it is possible to specify the JRE to run on. Click on the ... button there and select an Android Studio installation directory (e.g. /Applications/Android Studio.app/Contents on the Mac). This way it is possible to create a Run Configuration for all IntelliJ Platform IDEs you want to test your plugin on.

Bas Leijdekkers
  • 23,709
  • 4
  • 70
  • 68
  • didn't worked, obviously all the references to plugin development name spaces like com.intellij.openapi.* are not present in android studio – Apperside May 07 '16 at 13:54
  • Well it works for me. All API's used by the plugin have to be present in Android Studio or the plugin won't work. But I have edited my answer to add another solution which may work for you and is probably easier. – Bas Leijdekkers May 08 '16 at 09:10
  • Configuring an Android Studio SDK is a better solution, because it forces you to rebuild your project and make sure you're not using classes that are not available in AS. `com.intellij.openapi.*` *is* present in AS, it's built on top of the IntelliJ platform! – Bastien Jansen May 09 '16 at 07:09