This tutorial describes how to create and run PhoneGap, Apache Cordova and Ionic applications with IntelliJ IDEA.
1. Install the plugin
The support for PhoneGap, Apache Cordova and Ionic frameworks is available in IntelliJ IDEA, WebStorm and AppCode via the corresponding plugin. To install the plugin go to Settings → Plugins → Install JetBrains plugin…, then select PhoneGap/Cordova Plugin and click the Install plugin button.
After installing the plugin IntelliJ IDEA may ask you to restart the IDE. Please do so.
2. Configure the executable path
3. Create new or open an existing application
To open an existing PhoneGap/Cordova/Ionic application, simply select the application folder via use the File → Open menu. IntelliJ IDEA will detect the application and configure all the required project files automatically.
To create a new PhoneGap/Cordova/Ionic application, click File → New Project…, then select Static Web, and then PhoneGap/Cordova App.
Once you've pressed the Finish button, the IDE will create a new application along with the project files:
4. Create a run configuration to run the application
To be able to deploy and run your application, you need a corresponding run configuration. To create one, go to Run → Run Configurations… and use the Add button on the left to create a 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 from the IDE when using PhoneGap CLI due to its limitations):
To run the application, use the Run button on the toolbar or via the Run menu:
In the Run tool window that appears when you run the application you'll find the logs:
If you use the emulate command, the IDE will launch the emulator automatically before deploying the application.