You can use the IBM MobileFirst™ Platform
Command Line Interface (CLI) to
register your Cordova application to an instance MobileFirst Server.
About this task
Once you have the client side of your Cordova application
initially defined, you can prepare for further development tasks by
registering it to a
MobileFirst Server.
Procedure
- Check that the target MobileFirst Server is up and running.
- Navigate to the directory that contains your app, or one
of its subdirectories.
Important: - If the current directory is platforms/platform or
one of its subdirectories, the registration occurs for only the corresponding
platform.
- For the Windows platform,
if you want to register only specific versions of the Windows app, use the --windows option
of the mfpdev app register command to specify the
versions. For example: mfpdev app register --windows windows,windowsphone8 registers
the app for Windows 10 Universal
and Windows Phone 8.1. mfpdev
app register --windows windows8 registers the Windows 8.1 desktop portion of your Cordova
app.
- Register your app to the server. Use one of the following procedures:
- To register the app to the default server, run the following command:
mfpdev app register
Note: If you
have not previously set a default server and a MobileFirst Server is running on the local system, this command registers the app to
the local MobileFirst Server, and this server is made the default.
- To register your app to a server that is not the default server:
- Create a server profile by running the mfpdev server add
command. For example:
mfpdev server add Server1 -url https://company.mobile.com:9080 -login admin -password secretPassword!
For
more information about the mfpdev server add command, run
mfpdev help server add.
- To register your app to the server that you just defined, run the
mfpdev app register command, and specify the server profile
that you just created. For example:
mfpdev app register Server1
For more information about this command, including optional parameters,
run mfpdev help app register.
- To propagate the changes to all the target platforms of
your Cordova app, run the cordova prepare command.. The server URL is copied into the config.xml files
that are located in each platform's subdirectory.
Results
The app is registered to the target server. Data about the
app that is obtained from the
config.xml file
such as application name, version number, and app ID is sent to the
server. The root client properties file
config.xml is
updated with the value of the server's URL, as are the copies of
config.xml that
reside in subdirectories that correspond to each of the app's platforms.
What to do next
You can proceed with other development tasks that
depend on the MobileFirst Server. For example, you can preview your app, test your app's security
features, and manage your app from the MobileFirst Operations Console.