Running an Application

To run the app through the CrossMobile Managerial Application, select one of the four targets : Desktop:

iOS:

Android:

Unified Windows Platform (Experimental):

And Click Run

There are two ways open a CrossMobile Project with NetBeans.

  1. Open Netbeans from CrossMobile Application.

  2. Import CrossMobile Project directly to Netbeans

1. Open Intellij from CrossMobile Application.

To open a Crossmbile Project to NetBeans from the CrossMobile Application:

Click “Open” and then Select “in NetBeans”

If CrossMobile Apllication is not configured to use Netbeans this option will be grayed out. To configure see Initial Configuration.

2. Import CrossMobile Project directly to Netbeans

To open a CrossMobile project directly from Netbeans :

Click Open Project.

Navigate to the Projects root directory, select the project folder, and Click Open.

3. Run crossmobile Project from Netbeans

To run CrossMobile App for Destop expand the Configurations Drop down select desktop.

And press the Run Button.

To run for the other target you have to create a configuration first. To do that, expand Configurations Drop down and select Customize.

Press Add..

Add a Cofiguration Id and Activate the profiles you want (i.e. to run android : android,run)

deskop : builds a pure java app that runs on any desktop environment

ios : constructs a native ios project that opens with xcode and builds for ios devices

android : constructs a native android project that can open form android studio and builds for android

uwp (Experimental) : constructs a native ios project and uses Microsoft’s WinObjC to create a Unified Windows Platform project that builds for Windows

run : This is a special Profile that runs the application after it’s built.

 

Press OK to return to your project

Select the Created Cofiguration and press Build

There are two ways open a CrossMobile Project with IntelliJ IDEA.

  1. Open Intellij from CrossMobile Application.

  2. Import CrossMobile Project directly to IntelliJ IDEA

1. Open Intellij from CrossMobile Application.

To open a Crossmbile Project to IntelliJ IDEA from the CrossMobile Application:

Click “Open” and then Select “in IntelliJ IDEA”

If CrossMobile Apllication is not configured to use IntelliJ IDEA this option will be grayed out. To configure see Initial Configuration.

2. Import CrossMobile Project directly to IntelliJ IDEA

To open a CrossMobile project directly from IntelliJ IDEA :

Click Open.

Navigate to the Projects root directory, select the project folder, and Click Open.

3. Run crossmobile Project from IntelliJ IDEA

Both ways open the Project in IntelliJ IDEA

CrossMobile projects are Maven projects. You can build them as you would any Maven project with the exception that you must define the target platform as the target Profile.

Procceed to open the Maven Project tools

If Maven Project tools are not visible, click View -> Tool Windows -> Maven Projects

Expand Profiles to see available Profiles

CrossMobile supports six maven profiles. Four for target platform :

 

deskop : builds a pure java app that runs on any desktop environment

ios : constructs a native ios project that opens with xcode and builds for ios devices

android : constructs a native android project that can open form android studio and builds for android

uwp (Experimental) : constructs a native ios project and uses Microsoft’s WinObjC to create a Unified Windows Platform project that builds for Windows

One that runs the application run : This is a special Profile that runs the application after it’s built.

 

To run the application you jaust need to tick one of the target profiles and the run profile and double click install

There are two ways open a CrossMobile Project with IntelliJ IDEA.

  1. Open Android studio from CrossMobile Application.

  2. Import CrossMobile Project directly to Android studio

1. Open Android studio from CrossMobile Application.

To open a Crossmbile Project to Android studio from the CrossMobile Application:

Click “Open” and then Select “in Android studio”

If CrossMobile Apllication is not configured to use Android studio this option will be grayed out. To configure see Initial Configuration.

2. Import CrossMobile Project directly to Android studio

To open a CrossMobile project directly from Android studio :

Click “Open an existing Android Studio project”.

Navigate to the Projects root directory, select the project folder, and Click Open.

3. Run crossmobile Project from Android Studio

Once the project is Open in Android studio press Run

There are three ways open a CrossMobile Project with Xcode.

  1. Open XCode from CrossMobile Application.

  2. Open XCode project file directly

  3. Run CrossMobile Project for iOS

For CrossMobile to be able to build for ios or open xcode, it needs to run on a MAC with Xcode installed.

Open XCode from CrossMobile Application.

To open a CrossMobile Project to Xcode from the CrossMobile Application:

Click “Open” and then Select “in Xcode”

Open XCode project file directly.

To be able to open the project directly in Xcode, it needs to be built as iOS first;

Once Built you can either open Xcode click “Open another project…”, navigate to the projects root directory and click “Open”.

or navigate to the projects root directory and double click the .xcodeproj file.

Run CrossMobile Project for ios.
Run the project from CrossMobile Application as iOS or
from any IDE or terminal with profiles ios and run activated

Once the Project is Open in Xcode press Run

You can also use the console to run the application. CrossMobile projects are Maven projects. You can build them as you would any Maven project with the exception that you must define the target platform as the target Profile.

CrossMobile Supports 4 platform Profiles :

Desktop:

mvn install -Pdesktop

iOS:

mvn install -Pios

Android:

mvn install -Pandroid

Unified Windows Platform (Experimental):

mvn install -Puwp

To run the App from terminal, CrossMobile supports the optional Profile “run”. For Example to run the application on your Desktop type :

mvn install -Pdesktop,run

and so on.

If you want to use Eclipse as IDE open Eclipse and select your Workspace directory:

<figure>
<img src="/img/run/eclipse/eclipse_open.png#center" width="80%"/> 

When the IDE opens press File -> Import…

<figure>
<img src="/img/run/eclipse/project_imort_1.png#center" width="80%"/> 

 

Select Existing Maven Projects from the list.

<figure>
<img src="/img/run/eclipse/project_imort_2.png" width="100%"/> 

Click Browse, open the root directory of your CrossMobile Project and click Finish.

<figure>
<img src="/img/run/eclipse/project_imort_3.png" width="100%"/> 

It will display an error because CrossMobile is not in the Eclipse marketplace. This Cannot be resolved but the project will run normally. Click Finish and then OK.

<figure>
<img src="/img/run/eclipse/project_imort_4.png" width="100%"/> 

 

To run the project click on the small down button besde the Run button. adn select Run Configurations

 

<figure>
<img src="/img/run/eclipse/project_run_configurations_1.png#center" width="80%"/> 

Give the Configuration a name (for Example : Run Desktop)

  1. for Base directory click Variables.. and select project_loc

  2. for Goals specify install

  3. and for Profile the desired Profiles

CrossMobile supports six maven profiles. Four for target platform

 

deskop : builds a pure java app that runs on any desktop environment

ios : constructs a native ios project that opens with xcode and builds for ios devices

android : constructs a native android project that can open form android studio and builds for android

uwp (Experimental) : constructs a native ios project and uses Microsoft’s WinObjC to create a Unified Windows Platform project that builds for Windows

One that runs the application

run : This is a special Profile that runs the application after it’s built.

and click Run.