Skip to content

Instantly share code, notes, and snippets.

@VineetReynolds
Created February 3, 2014 13:01
Show Gist options
  • Save VineetReynolds/8783441 to your computer and use it in GitHub Desktop.
Save VineetReynolds/8783441 to your computer and use it in GitHub Desktop.

Install Hybrid Mobile Tools and CordovaSim

Hybrid Mobile Tools and CordovaSim are not installed as part of JBoss Developer Studio yet. They can be installed from JBoss Central as shown below:

  1. To install these plug-ins, drag the following link into JBoss Central: https://devstudio.jboss.com/central/install?connectors=org.jboss.tools.aerogear.hybrid. Alternatively, in JBoss Central select the Software/Update tab. In the Find field, type JBoss Hybrid Mobile Tools or scroll through the list to locate JBoss Hybrid Mobile Tools + CordovaSim. Select the corresponding check box and click Install.

  2. In the Install wizard, ensure the check boxes are selected for the software you want to install and click Next. It is recommended that you install all of the selected components.

  3. Review the details of the items listed for install and click Next. After reading and agreeing to the license(s), click I accept the terms of the license agreement(s) and click Finish. The Installing Software window opens and reports the progress of the installation.

  4. During the installation process you may receive warnings about installing unsigned content. If this is the case, check the details of the content and if satisfied click OK to continue with the installation.

  5. Once the installation is complete, you will be prompted to restart the IDE. Click Yes to restart now and No if you need to save any unsaved changes to open projects. Note that changes do not take effect until the IDE is restarted.

Once installed, you must inform Hybrid Mobile Tools of the Android SDK location before you can use Hybrid Mobile Tools actions involving Android.

To set the Android SDK location, click WindowPreferences and select Hybrid Mobile. In the Android SDK Directory field, type the path of the installed SDK or click Browse to navigate to the location. Click Apply and click OK to close the Preferences window.

Run the hybrid mobile application

The hybrid mobile application can be run on devices and simulators using the Hybrid Mobile Tools.

Run on an Android device or emulator

To run the project on a device, in the Project Explorer view, right-click the project name and click Run AsRun on Android Device. This option calls the external Android SDK to package the workspace project and run it on an Android device if one is attached. Note that the Android SDK must be installed and the IDE correctly configured to use the Android SDK for this option to execute successfully.

To run the project on an emulator, in the Project Explorer view, right-click the project name and click Run AsRun on Android Emulator. This requires that you create an Android AVD to run the application in a virtual device.

Example 1. What do you need for Android?

For running on an Android device or emulator, you need to install the Android Developer Tools, which require an Eclipse instance (JBoss Developer Studio could be used), and can run on Windows (XP, Vista, 7), Mac OS X (10.5.8 or later), Linux (with GNU C Library - glibc 2.7 or later, 64-bit distributions having installed the libraries for running 32-bit applications).

You must have Android API 17 or later installed on your system to use the Run on Android Emulator action.

Run on an iOS Simulator

In the Project Explorer view, right-click the project name and click Run AsRun on iOS Emulator. This option calls the external iOS SDK to package the workspace project into an XCode project and run it on the iOS Simulator.

Example 2. What do you need for iOS?

This option is only displayed when using OS X operating systems, for which the iOS Simulator is available. You must install Xcode 4.5+ which includes the iOS 6 SDK. You must also install a Simulator for iOS 5.x or higher, to run the project on a simulator.

Run on CordovaSim

In the Project Explorer view, right-click the project name and click Run AsRun with CordovaSim. This opens the application in CordovaSim, which is composed of a BrowserSim simulated device and a device input panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment