IntelliJ IDEA 2017.2 Help


This feature is supported in the Ultimate edition only.

The following is only valid when Node.js and PhoneGap/Cordova plugins are installed and enabled!

In IntelliJ IDEA, you can develop applications intended for running on various mobile platforms, including Android, using the PhoneGap, Apache Cordova, and Ionic frameworks.

On this page:

Before you start

  1. Make sure the PhoneGap/Cordova and the NodeJS plugins are enabled. The plugins are not bundled with IntelliJ IDEA, but they can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins. Once enabled, the plugins are available at the IDE level, that is, you can use them in all your IntelliJ IDEA projects.
  2. Download and install Node.js because NPM, which is a part of the framework, is also the easiest way to download PhoneGap and Cordova.
  3. Download and install an emulator tool. These tools are specific for the target platform and the operating system you use:

Installing PhoneGap/Cordova/Ionic

Open the built-in IntelliJ IDEA Terminal (press Alt+F12 or choose View | Tool Windows | Terminal on the main menu) and type one of the following commands at the command prompt:

npm install -- global phonegap npm install -- global cordova npm install -- global ionic

Preparing to use PhoneGap/Cordova/Ionic in a project

To start your development, you need a IntelliJ IDEA project with the PhoneGap/Cordova/Ionic-specific structure. You can have an application stub that meets these requirements generated automatically or open an existing PhoneGap/Cordova/Ionic project in IntelliJ IDEA and configure PhoneGap/Cordova/Ionic support in it.

Generating a PhoneGap/Cordova/Ionic application stub

  1. Choose File | New | Project on the main menu or click the New Project button on the Welcome screen.
  2. In the Project Category and Options dialog, which is the first page of the New Project wizard, choose Static Web in the left-hand pane.
  3. In the right-hand pane, choose PhoneGap/Cordova App and click Next.
  4. On the second page of the wizard, specify the project name and the folder to create it in. Specify the location of the executable file phonegap.cmd, or cordova.cmd, or ionic.cmd (see Installing PhoneGap/Cordova/Ionic).

When you click Finish, IntelliJ IDEA generates a skeleton of a PhoneGap/Cordova/Ionic application with the framework-specific structure.

Enabling PhoneGap/Cordova/Ionic integration in an existing project

  1. Open the desired PhoneGap/Cordova/Ionic project in IntelliJ IDEA by choosing File | Open on the main menu or clicking Open on the Welcome Screen.
  2. Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or IntelliJ IDEA | Preferences for macOS. Expand the Languages & Frameworks node, and then click PhoneGap/Cordova under JavaScript.
  3. On the PhoneGap/Cordova page that opens:
    1. Check the location of the executable file phonegap.cmd, or cordova.cmd, or ionic.cmd or specify the path to it if IntelliJ IDEA has not detected the executable file automatically.

      IntelliJ IDEA detects the installed version and displays it in the PhoneGap/Cordova Version read-only field,

    2. In the PhoneGap/Cordova Working Directory field, specify the folder under which the PhoneGap/Cordova/Ionic application files to run are stored.
    3. In the Plugins area, configure a list of plugins to use in your development by installing required packages. The list shows all the PhoneGap/Cordova/Ionic plugins that are currently installed on your computer, both at the global and at the project level.
      • To install a plugin, click the Install button new. In the Available Packages dialog box that opens, select the required package.

        To have the plugin installed globally so it is accessible from all your IntelliJ IDEA projects, select the Options checkbox and type --global in the text box. Click Install Package.

      • To remove a plugin, select it in the list and click the Uninstall button delete.
      • To upgrade a plugin to the latest available version, select the plugin in the list and click the Upgrade button arrowUp.
      See Apache Cordova Plugins and PhoneGap Plugins for information about plugins and their use.

Creating and launching a PhoneGap/Cordova/Ionic run configuration

PhoneGap/Cordova/Ionic applications are executed according to a dedicated run/debug configuration.

  1. On the main menu, choose Run | Edit Configurations. In the Edit Configuration dialog box that opens, click the Add New Configuration toolbar button add.png, and choose PhoneGap/Cordova on the context menu.
  2. In the Run/Debug Configuration: PhoneGap/Cordova dialog box that opens, specify the following:
    1. The name of the configuration.
    2. In the PhoneGap/Cordova Executable Path field, specify the location of the executable file phonegap.cmd, cordova.cmd, or ionic.cml (see Installing PhoneGap/Cordova/Ionic).
    3. In the PhoneGap/Cordova Working Directory field, specify the folder under which the PhoneGap/Cordova/Ionic application files to run are stored.
    4. From the Command drop-down list, choose the command to run. The contents of the drop-down list, depend on the actually used framework, namely, on the executable file specified in the PhoneGap/Cordova Executable Path field. The available options are:
    5. From the Platform drop-down list, choose the platform for running on which the application is intended. The available options are:
      • Android
      • ios To emulate this platform, you need to install the ios-sim command line tool globally. You can do it through the Node Package Manager (npm), see NPM or by running the sudo npm install ios-sim -g command, depending on your oeprating system.
      • amazon-fireos
      • firefoxos
      • blackberry10
      • ubuntu
      • wp8
      • windows8
      • browser
      Learn more about targeted platforms at and
    6. For Cordova and Ionic, specify the targeted virtual or physical Android device to run the application on: select the Specify Target checkbox and select the required device from the drop-down list. The list shows all the virtual and physical devices that are currently configured on our machine. See for details.

      If IntelliJ IDEA displays the following error message: Cannot detect ios-sim in path, make sure you have installed the ios-sim, see Before you start.

  3. To run a PhoneGap/Cordova/Ionic application, select the required run configuration from the list on the main tool bar and then choose Run | Run <configuration name> on the main menu or click the Run toolbar button run.png.
Last modified: 29 November 2017

See Also