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 IBM MobileFirst™ Platform
Command Line Interface (CLI).
For information about installing the CLI, see Installing the MobileFirst Platform CLI.
- A MobileFirst application
that is under development, with its files contained in a root directory
and subdirectories. The application must already include the IBM MobileFirst Platform Foundation SDK.
- Either a local MobileFirst Server running
on your computer or connectivity to a remote, running MobileFirst Server.
The server can be a MobileFirst Development Server,
the server that is provided with the IBM MobileFirst Platform Foundation
Developer Kit.
For information about installing and starting the MobileFirst Development Server server,
see Setting up the MobileFirst Development Server. For information
about installing a full MobileFirst Server,
see Installing IBM MobileFirst Platform Server.
About this task
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 you can create and manage adapters,
including calling adapter procedures, from the command line. Finally,
examples are provided of some optional command-line tasks.
Procedure
- Create at least one MobileFirst Server profile
with the mfpdev server add command. For
more information about this command, run mfpdev help server
add.
- Optional: Configure your app with the mfpdev
app config command. For more information about
this command, run mfpdev help app config.
- 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 Installing IBM MobileFirst Platform Server.
- 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.
- Change directories into your project. For
example, run cd YourProject.
- 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 your app type. For example, for an iOS app, see Registering iOS applications to MobileFirst Server).
- 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
- Create an adapter by running mfpdev adapter create. For more information about this command, run mfpdev
help adapter create.
- 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.
- Deploy the adapter by running mfpdev adapter deploy. For more information about this command, run mfpdev
help adapter deploy.
- 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
- Perform other tasks with the CLI whenever the need arises. For example:
- For cross-platform (Cordova) apps, you can
display a preview of the app in the built-in Mobile Browser Simulator or
in your web browser.
- Also for Cordova apps, you 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.
- You can display information about the available servers with the mfpdev
server info command. For more information about this command,
run mfpdev help server info.
- You 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 .
- You can modify an existing server profile with the mfpdev
server edit command. For more information about this command,
run mfpdev help server edit.