Performing a Local Cordova Build
Use these packager commands to build your iOS or Android application on your local cordova environment. This approach can be used for testing or as an alternative to building on the SAP Cloud Platform mobile service for SAP Fiori cloud build service. There is no local cordova build support for the Windows platform.
Before building your application locally, make sure your environment has been properly configured:
- Set up your build environment. For more information, see Requirements and Prerequisites.
-
Define your package properties with the appConfig.js file. For more information, see the Defining Package Properties in appConfig.js.
-
Create a local target directory and download the application assets and related components from the SAP Fiori front-end server, using the downloadfromfes command. For more information, see the Downloading from the SAP Fiori Front-End Server.
The typical command sequence for a local Cordova build:
- localbuild – builds the binaries locally.
- deploy – Deploy content to a SAP Mobile Platform or SAP Cloud Platform mobile service for SAP Fiori, mobile service. (Optional, required to use the AppUpdate plugin.)
- fetch – Download previously deployed content to the Cordova project from a SAP Mobile Platform or SAP Cloud Platform mobile service for SAP Fiori, mobile service. (Optional, required to use the AppUpdate plugin.)
Local Build
This command builds your application binaries locally in Cordova.
localbuild
- Required options
--targetDir <path to local target directory>
--platform <optional, either ios or android> If platform is not specified, all available platforms will be built.
- Example
node <path to SDK>/apps/packager/bin/packager --targetDir <target directory> --platform <optional, either ios or android> localbuild
Deploy
Deploy web content to an SAP Mobile Platform or SAP Cloud Platform mobile service for SAP Fiori, mobile service and make it available for app update. You can use this command to use the AppUpdate plugin, for more information see AppUpdate Plugin. To use this command, you will need to configure your SAP Mobile Platform or SAP Cloud Platform mobile service for SAP Fiori, mobile service server and specify the appID in the appConfig.js file. For more information, see Requirements and Prerequisites.
deploy
- Required options
--targetDir <path to local target directory>
--config <path to appConfig.js>
--host <app update Server host>
--port <app update Server admin port>
--username <app update Server username>
--password <app update Server password>
--platform <optional, either ios or android> If platform is not specified, all available platforms will be built.
- Example
node <path to SDK>/apps/packager/bin/packager --targetDir <target directory> --config <path to appConfig.js> --host <app update Server host> --port <app update Server admin port> --username <app update Server username> --password <app update Server password> --platform <optional, either ios or android> deploy
Fetch
Download previously deployed web content to the Cordova project in the target directory. This command must be used after the deploy command has been used. You can use this command to complete the AppUpdate process. For more information on the AppUpdate plugin, see AppUpdate Plugin. To use this command, you will need to configure your SAP Mobile Platform or SAP Cloud Platform mobile service for SAP Fiori, mobile service server and specify the appID in the appConfig.js file. For more information, see Requirements and Prerequisites.
deploy
- Required options
--targetDir <path to local target directory>
--config <path to appConfig.js>
--host <app update Server host>
--port <app update Server communication port>
--username <app update Server username>
--password <app update Server password>
--platform <optional, either ios or android> If platform is not specified, the command defaults to Android.
- Example
node <path to SDK>/apps/packager/bin/packager --targetDir <target directory> --config <path to appConfig.js> --host <app update Server host> --port <app update Server communication port> --username <app update Server username> --password <app update Server password> --platform <optional, either ios or android> fetch