Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This tutorial describes how to create and run PhoneGap, Apache Cordova and Ionic applications with IntelliJ IDEA.

Note
iconfalse

Before you follow the tutorialbegin, make sure you that have PhoneGap/Cordova/Ionic CLI and corresponding platform tools such as XCode Tools and Android SDK installed on your machine.

1.

...

Enable frameworks support

PhoneGap, Apache Cordova and Ionic frameworks support is available in IntelliJ IDEA, WebStorm and AppCode via the corresponding this plugin. To install the plugin it, go to

span
classshortcut
Settings
span
classshortcut
Plugins
span
classshortcut
Install JetBrains plugin…
, then select
span
classshortcut
PhoneGap/Cordova Plugin
and click the click 
span
classshortcut
Install plugin
button.
After installing the plugin

Note

IntelliJ IDEA

...

needs to be restarted to complete the plugin installation

2. Configure the executable path

One more thing you'll need to accomplish before you'll be able to create and run PhoneGap/Cordova/Ionic applications The next step is to configure the executable path for PhoneGap/Cordova/Ionic CLI via

span
classshortcut
Settings
span
classshortcut
Languages and Frameworks
span
classshortcut
JavaScript
span
classshortcut
PhoneGap/Cordova
.

3. Create

...

or open an

...

application

To open an existing PhoneGap/Cordova/Ionic application, simply select the application folder via use the its folder via 

span
classshortcut
File
span
classshortcut
Open
menu. IntelliJ IDEA Your IDE will detect the application and configure perform all the required project files configuration steps automatically.

To create Creating a new PhoneGap/Cordova/Ionic application, application takes just a tad longer: click

span
classshortcut
File
span
classshortcut
New Project…
, then select
span
classshortcut
Static Web
, and then
span
classshortcut
PhoneGap/Cordova App
.

Once you've pressed the Click 

span
classshortcut
Finish
button, and the IDE will create a new application along with and all the project files it requires:

4.

...

Run your application

To be able to deploy and run your application, you need a corresponding run configuration. To create one, go to to create a so called Run Configuration. For that, go to 

span
classshortcut
Run
span
classshortcut
Run Configurations…
and use the
span
classshortcut
Add
button on the left to create a
span
classshortcut
PhoneGap/Cordova
run configuration. Here you may specify the working directory for running your application, the command (emulate, run or serve), the platform (Android or iOS), and the target (notice, you can't choose the target Run Configuration.

Notice that it's created with default path and other settings, but you can,of course, change any of them as you need.

Note

You can't select a target device from the IDE when using PhoneGap CLI due

...

the existing limitations.

To run the application, use the After the configuration is saved, use it to run your application via 

span
classshortcut
Run
button on the toolbar or via the
span
classshortcut
Run
menu:

...

In the

span
classshortcut
Run
tool window that appears when you run after the application is started you 'll can find the output and logs:

If you use 're using the

span
classshortcut
emulate
command, the IDE will launch the emulator automatically before deploying the applicationan emulator will be automatically launched before application deployment.