Introduction
The CLI (Command Line Interface) provides a collection of commands used for creating, packaging, installing, and launching web apps in the command line environment. The CLI allows you to develop and test your app without having to use a specific IDE.
CLI Features
With the CLI, you can install your app on a target device, such as the emulator or webOS TV. Besides, you can retrieve, run, terminate, and remove the apps installed on the target device. You can use the CLI during any of the following stages of the development process:
Commands
The following shows the commands you could use:
Commands |
Descriptions |
---|---|
ares |
Provides the help menu for using the ares commands |
Creates a web app from a template. |
|
Creates and analyses 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 files. |
|
Gets a private key from webOS TV for the Developer Mode app. |
|
Retrieves a device's system information and monitors the device's resource usage. |
|
ares-extend-dev | Extends the session time of the developer mode for the Developer Mode app. |
-
Open All
-
- ares-launch
-
Runs or terminates an app installed on the target device.
This command can also display the list of apps running on the target device.
Usages
ares-launch [OPTION...] APP_ID
ares-launch [OPTION...] --hosted|-H APP_DIR [--host-ip|-I HOST_IP]
ares-launch [OPTION...] --close|-c APP_ID
ares-launch [OPTION...] --running|-r
ares-launch [OPTION...] --simulator|-s WEBOS_TV_VERSION APP_DIR
ares-launch --device-list|-D
ares-launch --version|-V
ares-launch --help|-h
Options
Option
Parameter
Description
-d, --device
TARGET_DEVICE
Specifies the target device where the web app is installed.
-H, --hosted
APP_DIR
Runs the app without installation. With this option, however, you cannot execute the app that includes JS services. For more information, see Debugging Web App.
-I, --host-ip
HOST_IP
Specifies the host's IP address. This option should be used with the --hosted option. The host IP for the --hosted option is selected automatically by default. If the --hosted option does not work with a network connection error, specify the host's IP address with the --host-ip option.
-c, --close
APP_ID
Terminates the app on the target device.
-r, --running
None
Lists apps that are running on the target device.
-s, --simulator
WEBOS_TV_VERSION
Specifies the webOS TV version of the simulator to be launched. For more information, see Debugging Web App.
-p, --params
PARAMS
Launches the web app with specified parameters.
--device-list
None
Lists all the available target devices.
-v
None
Displays the execution log.
--version
None
Displays the version of the ares-launch command.
-h, --help
None
Displays the help of the ares-launch command.
Parameters
Parameter
Description
APP_ID
ID of the app to run or terminate.
TARGET_DEVICE
Specifies the target device on which the app is installed.
WEBOS_TV_VERSION
Specifies the webOS TV version of the simulator on which the app is tested.
APP_DIR
Specifies the app's working directory to be tested.
HOST_IP
Specifies the host's IP address.
PARAMS
Specifies the parameters which are used on app launching. You should entere the parameter and value using JSON-type strings in the format '{"param1":"value1", "param2":"value2 which is containing spaces", ...}'.
Examples
Here are some examples of different usages:
Running an app installed on the emulator
ares-launch --device emulator com.example.sampleapp
Running an app with the URL parameter
ares-launch --device emulator com.example.sampleapp --params "{'url':'www.lge.com'}"
When you use a parameter, the web app receives the parameter with the
webOSLaunch
event. For more information about webOSLaunch event, see App Lifecycle.Listing apps running on the emulator
ares-launch --device emulator --running
Terminating the app currently running
ares-launch --device emulator --close com.example.sampleapp
Running an app without installation
ares-launch --device emulator --hosted sampleApp
Running an app without installation using the host IP address
ares-launch --device emulator --hosted sampleApp --host-ip 192.168.0.10
Running an app on the webOS TV 22 simulator
ares-launch -s 22 APP_DIR
Running an app on the simulator with parameters
ares-launch -s 22 APP_DIR -p "{'data1':'foo', 'data2':'bar'}"
ares-launch -s 22 APP_DIR -p "data1=foo" -p "data2=bar"