+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Getting started with the MobileFirst CLI

To get started with the CLI, create a MobileFirst Server profile, configure your app, and register your MobileFirst app to the MobileFirst Server.


Before you begin

This sequence of steps assumes that you already have the following on your local computer:

The numbered steps that follow describe a typical initial task flow from the command line. These steps are followed by a series of commands that demonstrates how we can create and manage adapters, including calling adapter procedures, from the command line. Finally, examples are provided of some optional command-line tasks.


Procedure

  1. Create at least one MobileFirst Server profile with the mfpdev server add command. For more information about this command, run mfpdev help server add.
  2. Optional: Configure your app with the mfpdev app config command. For more information about this command, run mfpdev help app config.
  3. If you are using a local development server, start the MobileFirst Server. For a remote server, verify with the administrator that the server is running. For instructions on starting the server see Install IBM MobileFirst Platform Server.
  4. Verify server access by opening the MobileFirst Operations Console for the MobileFirst Server. Run mfpdev server console. For more information about this command, run mfpdev help server console.
  5. Change directories into the project. For example, run cd YourProject.
  6. Register your app on the MobileFirst Server by running the mfpdev app register. For more information about this command, run mfpdev help app register. Also, see the information about registering your app in the IBM® Knowledge Center section for our app type. For example, for an iOS app, see Register iOS applications to MobileFirst Server).
  7. Optional: (Cordova applications only) Preview your app by using the mfpdev app preview command. For more information, run mfpdev help app preview.

Optional additional steps if your app uses an adapter

  1. Create an adapter by running mfpdev adapter create. For more information about this command, run mfpdev help adapter create.
  2. Build the adapter by changing to the adapter directory and running mfpdev adapter build. For example:

      $ cd MyAdapter
      $ mfpdev adapter build

    For more information about this command, run mfpdev help adapter build.

  3. Deploy the adapter by running mfpdev adapter deploy. For more information about this command, run mfpdev help adapter deploy.
  4. Call procedures on the deployed adapter by running mfpdev adapter call. For more information about this command, run mfpdev help adapter call.

Other optional steps

  1. Perform other tasks with the CLI whenever the need arises. For example:

    • For cross-platform (Cordova) apps, we can display a preview of the app in the built-in Mobile Browser Simulator or in your web browser.
    • Also for Cordova apps, we can generate and deploy a compressed (.zip) file of web resources to a MobileFirst Server with the mfpdev app webupdate command. For more information about this command, run mfpdev help app webupdate.
    • We can display information about the available servers with the mfpdev server info command. For more information about this command, run mfpdev help server info.
    • We can replicate app and adapter configuration settings from one MobileFirst Server to another by using the mfpdev app pull and mfpdev app push commands. For more information about these commands, run mfpdev help app pull and mfpdev help app push .
    • We can modify an existing server profile with the mfpdev server edit command. For more information about this command, run mfpdev help server edit.

Parent topic: The MobileFirst command-line interface (CLI)