Previewing the web resources of your application
This tutorial covers the following topics.
- Adding an environment to the MobileFirst project
- Reviewing the folder structure
- Previewing the web resources
In the next tutorials, you learn how to preview the application in specific mobile environments.
Adding an environment to the MobileFirst project
To add an environment:
From a terminal window, navigate to the application's folder and run the following CLI command:
mfp add environment. An interactive menu will be displayed.
- Click the MobileFirst icon in the menubar and select MobileFirst Environment.
- Select the application to which you would like to add an environment and select one or more environments.
- Click Finish. A new folder with the environmen name is added to the project structure.
Reviewing the folder structureThe screen shot to the right depicts the iPhone environment, but the explanation below applies to any mobile environment (iPhone, iPad, Android, BlackBerry, Windows Phone 8, Windows 8).
The mobile environment includes the following folders:
- CSS – The properties that are specified in this folder override the CSS files from the common folder.
- Images – You can add environment-specific images in this folder. If images with the same file names exist in the common folder, they are overwritten in the application.
- The native folder contains automatically generated native project code.
Files in the
native\wwwfolder are regenerated each time the application is built. Any changes that are made to these files are lost.
- The nativeResources folder contains resources that are used by the native code.
Previewing the web resources
After the application is built and deployed in MobileFirst Studio, it can be previewed in the Mobile Browser Simulator (MBS).
- Right-click the project and select Open MobileFirst Console, or browse to the MobileFirst Console. Typically the URL is
- Click Applications to see the list of applications in your project.
- Click the application name, HelloWorld, to see the list of environments.
- To preview the web resources of an environment, click the Preview button that is below the environment name.
- To preview the common resources, click the Preview button that is in Common Ressources.
You can use the Mobile Browser Simulator to emulate Cordova or preview your application with different device skins.
Limitation about Mobile Browser Simulator: To preview an application that contains security tests that rely on the device (such as autoprovisioning or authenticity), you must temporarily change the security tests so that they do not use the device identification.