cordova preview

Previews the current application.

Syntax

mfp cordova preview [--platform|-p <environments> --type|-t <browser>]7001_byocord

Parameters

--platform|-p <environments>

Environments with which you want to preview the application. Valid environments are only environments that exist in your app.

If your comma-separated list of environments contains at least one supported environment, then those environments are used. If the environments that are passed in do not exist in the application or are invalid environments, your app is previewed against the first valid environment in the application.

--type|-t <browser>
The type of browser with which you preview your app. Valid values:
  • mbs: Mobile Browser Simulator.
  • browser: Your default browser.

If you do not specify a type, the default browser is used. This default preview type is defined by the mfp config command.

Usage

To use this command, the JAVA_HOME environment variable must be set to a file path. This file path must be to a Java™ Development Kit (JDK) root directory.

You must run mfp start on a legacy project to use this command. You must have a project runtime that is deployed to push and preview Cordova applications.

  • Interactive mode: $ mfp cordova preview. You are prompted for the browser type and environments.
  • Direct with the environment option: $ mfp cordova preview --platform android.
  • Direct with browser option: $ mfp cordova preview --type mbs. If you run this command inside a Cordova app folder, the preview is opened for you to view each environment in the app.
  • Direct with both environments: $ mfp preview --platform android --type mbs.