+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Opening a Cordova project in a platform development environment

With the IBM MobileFirstâ„¢ Studio plug-in, we can open your Cordova project in the platform IDE directly from Eclipse.


Before you begin

Be sure that you have the following prerequisites before you start the procedure:

Important: To use this function, we must install the IBM MobileFirst Studio plug-in as explained in Integrating the MobileFirst Studio plug-in to manage a Cordova project in Eclipse.

After you create a Cordova project and add the iOS or Android platform, you might want to open the project within the Xcode or Android Studio environment. We can open it directly from within the Eclipse environment if you have the IBM MobileFirst Studio plug-in.

Important: Do not edit the code in your projects in the Android Studio or Xcode environment. Changes that are made in the IDE only apply to the platform that is open and can be overwritten by information at the project level. To open the project in the native IDE, complete the following steps:


Procedure

  1. Ensure that your path to Android Studio is set correctly by selecting Preferences > MobileFirst Studio Plugins.

    • In a Windows environment, specify the directory that contains the bin file, which is often C:\Program Files\Android\Android Studio.
    • In an OSX environment, specify the directory that contains the Android Studio application, which is often /Applications.

  2. Import your Android project into Android Studio before launching it from Eclipse. You only have to do this the first time that you are launching the Android project from Eclipse.

    1. Open Android Studio.
    2. Select File > New > Import project....
    3. Select the project folder, the build.gradle file, or the settings.gradle file for the project that we want to import. We can usually find the build.gradle file and the settings.gradle file in the c:\dir\project_name\platforms\android directory.
    We can open your Cordova project that contains the Android platform in Android Studio directly from the Eclipse IDE.
  3. Open your Cordova project in the Eclipse development environment.
  4. Right-click the project and select Run as... > Xcode project or Run as... > Android Studio project to open the project in the native environment. If you are not in an OSX environment, then the Xcode project option is not available.


Results

The project opens in the selected development environment.

Parent topic: IBM MobileFirst Studio plug-in for managing Cordova projects in Eclipse