Command Line Interface
The CLI (Command Line Interface) provides a collection of commands used for creating, packaging, installing, and launching the web app in the command line environment. The CLI allows you to develop and test app without having to use a specific IDE.
Features of CLI
With the CLI, you can install your app on the emulator. You can also retrieve, run, terminate, and remove the apps that are installed on the webOS TV.
The CLI can be used during any of the following stages of the development process:
The following shows the commands you could use:
Command |
Description |
---|---|
ares | Provides the help menu for using the ares commands |
Creates a web app from a template. |
|
Creates an app package file. |
|
Manages the target devices. |
|
Installs an app on the target device. |
|
Runs or terminates the web app. | |
Runs the Web Inspector for web app debugging. |
|
Runs the Web server for testing local app file. |
|
Gets private key from webOS TV for Developer Mode App. |
Usages and Options
This section describes the usages of CLI commands and options.
-
Open All
-
- ares-generate
- ares-package
- ares-setup-device
- ares-install
- ares-launch
-
This command runs or terminates the application installed on the target device. This command can also display the list of applications running on the target device.
Usages
ares-launch [OPTION...] APP_ID
ares-launch [OPTION...] --hosted|-H APP_DIR
ares-launch [OPTION...] --close APP_ID
ares-launch [OPTION...] --running|-r
ares-launch --version|-V
ares-launch --help|-h
Options
Option
Parameter
Description
-d, --device
TARGET_DEVICE
Specifies the target device where the web application is installed.
-H, --hosted
APP_DIR
Runs application without installation. An application that includes JS Service cannot be executed with this option.
--close
APP_ID
Terminates application on target device.
-r, --running
None
Lists applications which are running on target device.
-p, --params
PARAMS
Launches a web application with specified parameters.
-v
None
Displays the execution log.
--version
None Displays the version of ares-launch command.
-h, --help
None Displays the help of ares-launch command.
Parameters
Parameter
Description
APP_ID
ID of the application to run or terminate.
TARGET_DEVICE
Specifies the target device on which the application is installed.
PARAMS
Specifies the parameters which are used on web application launching. It is entered using JSON-type strings in the format '{"param1":"value1", "param2":"value2 which is containing spaces", ...}'.
Examples
Here are some examples of the different uses:
Running the application installed on the emulator
ares-launch --device emulator com.example.sampleapp
Running the application with url parameter
ares-launch --device emulator com.example.sampleapp --params "{'url':'www.lge.com'}"
When you use a parameter, web app will receive the parameter with webOSLaunch event. For more detailed on webOSLaunch event, see App Lifecycle.
Listing applications running on the emulator
ares-launch --device emulator --running
Terminating application currently running
ares-launch --device emulator --close com.example.sampleapp
Running the application without installation
ares-launch --device emulator --hosted sampleApp
- ares-inspect
- ares-server
- ares-novacom