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:
- A Mars Javaâ„¢ EE version of Eclipse, or later, with the IBM MobileFirst Studio plug-in installed.
- Java JRE version 7, or later.
- Node.js version 4.x, or later.
- The Cordova command-line interface, version 6.1.1, or later.
- The IBM MobileFirst Platform Command Line Interface (CLI).
- An internet connection.
- A Cordova project with an iOS or Android platform, and the cordova-plugin-mfp plug-in installed.
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
- 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.
- 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.
We can open your Cordova project that contains the Android platform in Android Studio directly from the Eclipse IDE.
- Open Android Studio.
- Select File > New > Import project....
- 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.
- Open your Cordova project in the Eclipse development environment.
- 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