cordova create

Creates a Cordova project.

Syntax

mfp cordova create [
  • <name>
  • [--platform|-p <platform>]
  • [--id|-i <package>]
  • [--template|-t <template>]
  • [--appversion|-a <version>]
]

Parameters

<name>
Name of your project.
[--platform|-p <platform>]
Space-separated list of platforms to add to the project. Valid values: ios and android.
Important: If you are creating an app for the Android platform, make sure that you set your ANDROID_HOME environment variable to your Android SDK.
[--id|-i <package>]
Package ID in reverse domain notation. Example: com.ibm.hellocordova.
[--template|-t <template>]
Template or archive to use as a base line. Example: templates/www.
Important:
  • The template must contain a config.xml file. Otherwise, a config.xml file that is incompatible with IBM MobileFirst™ Platform Foundation is automatically generated, and an error will occur.
  • The config.xml file in the template that you use must specify Cordova plug-ins that are compatible with the Cordova platforms that are supplied with IBM MobileFirst Platform Foundation; otherwise an error will occur. For a list of these platforms and other components, see Product components.
[--appversion|-a <version>]
Version of the app in the format of number.number.number. Example: 5.1.2

Usage

You must run this command outside of an existing project.

  • Interactive mode: $ mfp cordova create, then follow the prompts.
  • Direct mode: $ mfp cordova create helloCordova --platform android, and you can select your plug-ins.