Running an Application

Home / Running an Application

The basic supported IDE is NetBeans. CrossMobile is also platform-specific for Android Studio and Xcode, which are accessible using the interface.In addition if your favorite IDE is Eclipse or IntelliJ IDEA you may also use one of them. Get started following the guides below:

If you want to use NetBeans click the desktop icon and then the code icon from within the interface:

This opens your project with NetBeans as you see:

Alternatively you may open the project that you created with NetBeans IDE on your own and when you need to run it just select the device from within the IDE as you see below:

Click run and your application runs!

If you want to use Eclipse as IDE open Eclipse and select the directory of your CrossMobile project:

Select the directory of your CrossMobile project and open it.

If you click run you are prompted to select a way to run your project. Select Maven build and click OK.

Now you need to configure Run parameters.

Set the field Goals to “install” if you just want to build your project or “deploy” if you want to run your project. Also set Profile as “desktop” or “android” in order to run your application on your desktop or if you want plug-in an Android device. Be sure that the Base directory is the directory of your project.

Then click Run and your application runs!

Open IntelliJ IDEA and select Import Project:

Select the directory of your CrossMobile project:

Select “Import project from existing sources”, choose Maven and then click Next.

Make sure to check “Import Maven projects automatically” on the next window and click next.

Then select the desktop as profile and click Next.

Then click Next (the project is preselected):

Again you are prompted to set SDK configurations, just click Next.

Then leave the name of your project as it is:

Finally click Finish and your project opens.

You won’t be able to run your project as it is.

You need to set up configurations. Go to View-> Windows Tools -> Maven Projects.

Then select profile “desktop”.

Then click deploy -> Run Maven Build:

And your application runs!

In the same way, if you want to use Android Studio as the IDE of your project then click Android icon and Code icon. This, as you see, launches your Android Studio:

Your project opens with Android Studio:

Where you can edit and run your project!

If you want to work using Xcode then click Apple icon and Code icon:

CrossMobile opens Xcode for you:

And you are ready to navigate and edit your project with Xcode:

You can also use the console to run the application. To do that, open then console, go to the root of your project folder and run the following:

For Desktop:
mvn install -Pdesktop,run

For Android:
mvn install -Pandroid,run

For iOS:
mvn install -Pios,run

The self-contained jar for the desktop is found inside the folder:  target/{name}-{version}-run.jar

The Android APK is found inside the folder: target/app/build/outputs/apk/{name}.apk